Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generic contracts for object authenticity management #62

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
push:
branches:
- master
- "[0-9]+"
- "[0-9]+.[0-9]+"
workflow_dispatch:
pull_request:

jobs:
check-generic-contracts-and-functions:
name: Gradle check for generic contracts and functions
runs-on: ubuntu-latest

defaults:
run:
working-directory: generic-contracts-and-functions

steps:
- uses: actions/checkout@v4

- name: Set up JDK 1.8
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Check with Gradle
run: ./gradlew check

- name: Package artifacts
if: always()
run: |
mkdir -p /tmp/artifacts-generic-contracts-and-functions
cp -a build/reports/tests/test /tmp/artifacts-generic-contracts-and-functions/
cp -a build/reports/spotbugs /tmp/artifacts-generic-contracts-and-functions/

- uses: actions/upload-artifact@v4
if: always()
with:
name: artifacts-generic-contracts-and-functions
path: /tmp/artifacts-generic-contracts-and-functions
84 changes: 84 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
##############################
## Java
##############################
.mtj.tmp/
*.class
*.jar
*.war
*.ear
*.nar
hs_err_pid*

##############################
## Maven
##############################
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
pom.xml.bak
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar

##############################
## Gradle
##############################
bin/
build/
.gradle
.gradletasknamecache
gradle-app.setting
!gradle-wrapper.jar

##############################
## IntelliJ
##############################
out/
.idea/
.idea_modules/
*.iml
*.ipr
*.iws

##############################
## Eclipse
##############################
.settings/
bin/
tmp/
.metadata
.classpath
.project
*.tmp
*.bak
*.swp
*~.nib
local.properties
.loadpath
.factorypath

##############################
## NetBeans
##############################
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml

##############################
## Visual Studio Code
##############################
.vscode/
.code-workspace

##############################
## OS X
##############################
.DS_Store
80 changes: 80 additions & 0 deletions generic-contracts-and-functions/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
plugins {
id 'com.diffplug.spotless' version '6.13.0'
id 'com.github.spotbugs' version '5.2.5'
id 'net.ltgt.errorprone' version '3.1.0'
}

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'com.diffplug.spotless'

ext {
scalarDlVersion = '3.9.0'
scalarDbVersion = '3.13.0'
junitVersion = '5.10.3'
junitPlatformVersion = '1.10.3'
mockitoVersion = '4.11.0'
assertjVersion = '3.26.0'
errorproneVersion = '2.10.0'
errorproneJavacVersion = '9+181-r4173-1'
spotbugsVersion = '4.8.6'
}

repositories {
mavenCentral()
}

dependencies {
implementation group: 'com.scalar-labs', name: 'scalardl-java-client-sdk', version: "${scalarDlVersion}"
implementation group: 'com.scalar-labs', name: 'scalardb', version: "${scalarDbVersion}"
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: "${junitVersion}"
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: "${junitVersion}"
testImplementation group: 'org.junit.platform', name: 'junit-platform-console', version: "${junitPlatformVersion}"
testImplementation group: 'org.assertj', name: 'assertj-core', version: "${assertjVersion}"
testImplementation group: 'org.mockito', name: 'mockito-core', version: "${mockitoVersion}"
testImplementation group: 'org.mockito', name: 'mockito-inline', version: "${mockitoVersion}"

// for Error Prone
errorprone "com.google.errorprone:error_prone_core:${errorproneVersion}"
errorproneJavac "com.google.errorprone:javac:${errorproneJavacVersion}"

// for SpotBugs
spotbugs "com.github.spotbugs:spotbugs:${spotbugsVersion}"
compileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugsVersion}"
testCompileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugsVersion}"
}

test {
useJUnitPlatform()
}

spotless {
java {
target 'src/*/java/**/*.java'
importOrder()
removeUnusedImports()
googleJavaFormat('1.7')
}
}

spotbugs {
ignoreFailures = false
showStackTraces = true
showProgress = true
effort = 'default'
reportLevel = 'default'
maxHeapSize = '1g'
extraArgs = [ '-nested:false' ]
jvmArgs = [ '-Duser.language=en' ]
}

spotbugsMain.reports {
html.enabled = true
}

spotbugsTest.reports {
html.enabled = true
}

sourceCompatibility = 1.8
targetCompatibility = 1.8
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading