diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..4e8757b
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,90 @@
+name: CI
+
+on: [push, pull_request]
+
+jobs:
+ build:
+ name: Build Java Pinning
+
+ runs-on: ubuntu-24.04
+ strategy:
+ matrix:
+ java:
+ - 17
+ - 21
+ env:
+ PRIMARY_JAVA_VERSION: 21
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Set up JDK ${{ matrix.java }}
+ uses: actions/setup-java@v1
+ with:
+ java-version: ${{ matrix.java }}
+
+ # Caches
+ - name: Cache Maven
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2/repository
+ key: maven-${{ hashFiles('**/build.gradle') }}
+ restore-keys: |
+ maven-
+ - name: Cache Gradle
+ uses: actions/cache@v2
+ with:
+ path: ~/.gradle/caches
+ key: gradle-caches-${{ hashFiles('**/build.gradle') }}
+ restore-keys:
+ gradle-caches
+ - name: Cache Android SDK
+ uses: actions/cache@v2
+ with:
+ path: |
+ ~/.android/sdk
+ key: android-${{ hashFiles('build.gradle') }}
+ restore-keys: |
+ android-
+
+ # Pre-reqs
+ - name: Install Android SDK Manager
+ uses: android-actions/setup-android@v2
+ - name: Install Android SDK
+ run: |
+ sdkmanager "platforms;android-15" "platforms;android-30"
+
+ # Testing
+ - name: Gradle Check
+ run: ./gradlew check --stacktrace
+
+ # Test local publish
+ - name: Gradle publish
+ run: ./gradlew publishToMavenLocal --stacktrace
+
+ # Javadoc
+ - name: Javadoc
+ if: ${{ matrix.java == env.PRIMARY_JAVA_VERSION }}
+ run: ./gradlew javadocAll --stacktrace
+
+ # Test Coverage Report
+ - name: Jacoco Test Coverage
+ run: ./gradlew java-pinning-java11:testCodeCoverageReport
+
+ # Coveralls
+ - name: Report coverage stats to Coveralls
+ if: ${{ matrix.java == env.PRIMARY_JAVA_VERSION }}
+ uses: coverallsapp/github-action@v2
+ with:
+ format: jacoco
+ file: java-pinning-java11/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml
+
+ # Upload build artifacts
+ - name: Upload build artifacts
+ uses: actions/upload-artifact@v4
+ with:
+ name: java-pinning-java-${{ matrix.java }}
+ path: |
+ java-pinning-*/build/libs/*.jar
+ !**/*-test-fixtures.jar
+ !**/*-tests.jar
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..8aabb0e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,26 @@
+GRADLE ?= ./gradlew
+
+.PHONY: all
+all: check codecov eclipse javadocAll show-dependency-updates
+
+.PHONY: codecov
+codecov:
+ $(GRADLE) java-pinning-java11:testCodeCoverageReport
+ echo "Code coverage report available at file://$(PWD)/java-pinnging-java11/build/reports/jacoco/testCodeCoverageReport/html/index.html"
+
+.PHONY: check
+check:
+ $(GRADLE) $@
+
+.PHONY: eclipse
+eclipse:
+ $(GRADLE) $@
+
+.PHONY: javadocAll
+javadocAll:
+ $(GRADLE) $@
+ echo "javadoc available at file://$(PWD)/build/javadoc/index.html"
+
+.PHONY: show-dependency-updates
+show-dependency-updates:
+ $(GRADLE) dependencyUpdates
diff --git a/build-logic/build.gradle b/build-logic/build.gradle
new file mode 100644
index 0000000..de053e0
--- /dev/null
+++ b/build-logic/build.gradle
@@ -0,0 +1,16 @@
+plugins {
+ id 'groovy-gradle-plugin'
+}
+
+repositories {
+ gradlePluginPortal()
+ google()
+}
+
+dependencies {
+ implementation "biz.aQute.bnd:biz.aQute.bnd.gradle:7.0.0"
+ implementation "net.ltgt.gradle:gradle-errorprone-plugin:4.0.1"
+ implementation "ru.vyarus:gradle-animalsniffer-plugin:1.7.1"
+ implementation "com.github.ben-manes:gradle-versions-plugin:0.51.0"
+ implementation 'com.android.tools.build:gradle:8.7.0'
+}
diff --git a/build-logic/settings.gradle b/build-logic/settings.gradle
new file mode 100644
index 0000000..37e09a3
--- /dev/null
+++ b/build-logic/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'javapinning-build-logic'
diff --git a/build-logic/src/main/groovy/eu.geekplace.javapinning.android-conventions.gradle b/build-logic/src/main/groovy/eu.geekplace.javapinning.android-conventions.gradle
new file mode 100644
index 0000000..2ec5557
--- /dev/null
+++ b/build-logic/src/main/groovy/eu.geekplace.javapinning.android-conventions.gradle
@@ -0,0 +1,11 @@
+plugins {
+ id 'ru.vyarus.animalsniffer'
+ id 'eu.geekplace.javapinning.common-conventions'
+}
+
+dependencies {
+ signature "net.sf.androidscents.signature:android-api-level-${minAndroidSdk}:4.0.3_r5@signature"
+}
+animalsniffer {
+ sourceSets = [sourceSets.main]
+}
diff --git a/build-logic/src/main/groovy/eu.geekplace.javapinning.common-conventions.gradle b/build-logic/src/main/groovy/eu.geekplace.javapinning.common-conventions.gradle
new file mode 100644
index 0000000..e718872
--- /dev/null
+++ b/build-logic/src/main/groovy/eu.geekplace.javapinning.common-conventions.gradle
@@ -0,0 +1,37 @@
+ext {
+ javaVersion = JavaVersion.VERSION_11
+ javaMajor = javaVersion.getMajorVersion()
+ minAndroidSdk = 15
+
+ androidBootClasspath = getAndroidRuntimeJar(minAndroidSdk)
+
+ // Export the function by turning it into a closure.
+ // https://stackoverflow.com/a/23290820/194894
+ getAndroidRuntimeJar = this.&getAndroidRuntimeJar
+}
+
+repositories {
+ mavenCentral()
+ google()
+ mavenLocal()
+}
+
+def getAndroidRuntimeJar(androidApiLevel) {
+ def androidHome = getAndroidHome()
+ def androidJar = new File("$androidHome/platforms/android-${androidApiLevel}/android.jar")
+ if (androidJar.isFile()) {
+ return androidJar
+ } else {
+ throw new Exception("Can't find android.jar for API level ${androidApiLevel}. Please install corresponding SDK platform package")
+ }
+}
+
+def getAndroidHome() {
+ def androidHomeEnv = System.getenv("ANDROID_HOME")
+ if (androidHomeEnv == null) {
+ throw new Exception("ANDROID_HOME environment variable is not set")
+ }
+ def androidHome = new File(androidHomeEnv)
+ if (!androidHome.isDirectory()) throw new Exception("Environment variable ANDROID_HOME is not pointing to a directory")
+ return androidHome
+}
diff --git a/build-logic/src/main/groovy/eu.geekplace.javapinning.java-conventions.gradle b/build-logic/src/main/groovy/eu.geekplace.javapinning.java-conventions.gradle
new file mode 100644
index 0000000..d266df1
--- /dev/null
+++ b/build-logic/src/main/groovy/eu.geekplace.javapinning.java-conventions.gradle
@@ -0,0 +1,261 @@
+plugins {
+ id 'biz.aQute.bnd.builder'
+ id 'checkstyle'
+ id 'eclipse'
+ id 'idea'
+ id 'jacoco'
+ id 'java'
+ id 'java-library'
+ id 'maven-publish'
+ id 'net.ltgt.errorprone'
+ id 'signing'
+ id 'com.github.ben-manes.versions'
+
+ id 'jacoco-report-aggregation'
+ id 'test-report-aggregation'
+
+ id 'eu.geekplace.javapinning.common-conventions'
+ id 'eu.geekplace.javapinning.javadoc-conventions'
+}
+
+version readVersionFile()
+
+ext {
+ isSnapshot = version.endsWith('-SNAPSHOT')
+ gitCommit = getGitCommit()
+ documentationDir = new File(projectDir, 'documentation')
+ releasedocsDir = new File(buildDir, 'releasedocs')
+ rootConfigDir = new File(rootDir, 'config')
+ sonatypeCredentialsAvailable = project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')
+ isReleaseVersion = !isSnapshot
+ isContinuousIntegrationEnvironment = Boolean.parseBoolean(System.getenv('CI'))
+ signingRequired = !(isSnapshot || isContinuousIntegrationEnvironment)
+ sonatypeSnapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
+ sonatypeStagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
+ builtDate = (new java.text.SimpleDateFormat("yyyy-MM-dd")).format(new Date())
+ junitVersion = '5.11.3'
+}
+
+group = 'eu.geekplace.javapinning'
+
+java {
+ sourceCompatibility = javaVersion
+ targetCompatibility = sourceCompatibility
+}
+
+ext.sharedManifest = manifest {
+ attributes('Implementation-Version': version,
+ 'Implementation-GitRevision': ext.gitCommit,
+ 'Built-JDK': System.getProperty('java.version'),
+ 'Built-Gradle': gradle.gradleVersion,
+ 'Built-By': System.getProperty('user.name')
+ )
+}
+
+eclipse {
+ classpath {
+ downloadJavadoc = true
+ }
+}
+
+// Make all project's 'test' target depend on javadoc, so that
+// javadoc is also linted.
+test.dependsOn javadoc
+
+tasks.withType(JavaCompile) {
+ // Some systems may not have set their platform default
+ // converter to 'utf8', but we use unicode in our source
+ // files. Therefore ensure that javac uses unicode
+ options.encoding = "utf8"
+ options.compilerArgs = [
+ '-Xlint:all',
+ // Set '-options' because a non-java7 javac will emit a
+ // warning if source/target is set to 1.7 and
+ // bootclasspath is *not* set.
+ '-Xlint:-options',
+ '-Werror',
+ ]
+ options.release = Integer.valueOf(javaMajor)
+}
+
+jacoco {
+ toolVersion = "0.8.12"
+}
+
+jacocoTestReport {
+ dependsOn test
+ reports {
+ xml.required = true
+ }
+}
+
+dependencies {
+ testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
+ testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
+
+ // https://stackoverflow.com/a/77274251/194894
+ testImplementation "org.junit.platform:junit-platform-launcher:1.11.3"
+
+ errorprone 'com.google.errorprone:error_prone_core:2.35.1'
+}
+
+test {
+ useJUnitPlatform()
+
+ maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
+
+ // Enable full stacktraces of failed tests. Especially handy
+ // for environments like Travis.
+ testLogging {
+ events "failed"
+ exceptionFormat "full"
+ }
+}
+
+jar {
+ bundle {
+ bnd(
+ '-removeheaders': 'Tool, Bnd-*',
+ '-exportcontents': 'eu.geekplace.javapinning.*',
+ )
+ }
+}
+checkstyle {
+ toolVersion = '10.18.2'
+}
+task sourcesJar(type: Jar, dependsOn: classes) {
+ archiveClassifier = 'sources'
+ from sourceSets.main.allSource
+}
+task javadocJar(type: Jar, dependsOn: javadoc) {
+ archiveClassifier = 'javadoc'
+ from javadoc.destinationDir
+}
+task testsJar(type: Jar) {
+ archiveClassifier = 'tests'
+ from sourceSets.test.output
+}
+configurations {
+ testRuntime
+}
+artifacts {
+ // Add a 'testRuntime' configuration including the tests so that
+ // it can be consumed by other projects (smack-omemo-signal for
+ // example). See http://stackoverflow.com/a/21946676/194894
+ testRuntime testsJar
+}
+
+publishing {
+ publications {
+ mavenJava(MavenPublication) {
+ from components.java
+ artifact sourcesJar
+ artifact javadocJar
+ artifact testsJar
+ pom {
+ name = 'Java Pinning'
+ url = 'http://javapinning.geekplace.eu'
+ afterEvaluate {
+ description = project.description
+ }
+
+ scm {
+ url = 'https://github.com/flowdalic/android-pinning'
+ connection = 'scm:git@github.com:flowdalic/android-pinning.git'
+ developerConnection = 'scm:git@github.com:flowdalic/android-pinning.git'
+ }
+
+ licenses {
+ license {
+ name = 'The Apache Software License, Version 2.0'
+ url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution = 'repo'
+ }
+ }
+
+ developers {
+ developer {
+ id = 'flow'
+ name = 'Florian Schmaus'
+ email = 'flo@geekplace.eu'
+ }
+ }
+ }
+ }
+ }
+ repositories {
+ maven {
+ url isSnapshot ? sonatypeSnapshotUrl : sonatypeStagingUrl
+ if (sonatypeCredentialsAvailable) {
+ credentials {
+ username = sonatypeUsername
+ password = sonatypePassword
+ }
+ }
+ }
+ }
+}
+
+// Workaround for gpg signatory not supporting the 'required' option
+// See https://github.com/gradle/gradle/issues/5064#issuecomment-381924984
+// Note what we use 'signing.gnupg.keyName' instead of 'signing.keyId'.
+tasks.withType(Sign) {
+ onlyIf {
+ project.hasProperty('signing.gnupg.keyName')
+ }
+}
+signing {
+ required { signingRequired }
+ useGpgCmd()
+ sign publishing.publications.mavenJava
+}
+
+tasks.withType(JavaCompile) {
+ options.errorprone {
+ disableWarningsInGeneratedCode = true
+ excludedPaths = ".*/jmh_generated/.*"
+ error(
+ "UnusedVariable",
+ "UnusedMethod",
+ "MethodCanBeStatic",
+ )
+ errorproneArgs = [
+ // Disable MissingCasesInEnumSwitch error prone check
+ // because this check is already done by javac as incomplete-switch.
+ '-Xep:MissingCasesInEnumSwitch:OFF',
+ '-Xep:StringSplitter:OFF',
+ '-Xep:JavaTimeDefaultTimeZone:OFF',
+ '-Xep:InlineMeSuggester:OFF',
+ ]
+ }
+}
+
+// TODO: Note sure what this does (did). Was there prior the build-logic conversion.
+// dependencies {
+// androidProjects.each { project ->
+// api project
+// }
+// }
+
+def getGitCommit() {
+ def projectDirFile = new File("$projectDir")
+ def dotGit = new File(projectDirFile, ".git")
+ if (!dotGit.isDirectory()) return 'non-git build'
+
+ def cmd = 'git describe --always --tags --dirty=+'
+ def proc = cmd.execute(null, projectDirFile)
+ def gitCommit = proc.text.trim()
+ assert !gitCommit.isEmpty()
+ gitCommit
+}
+
+def readVersionFile() {
+ def versionFile = new File(rootDir, 'version')
+ if (!versionFile.isFile()) {
+ throw new Exception("Could not find version file")
+ }
+ if (versionFile.text.isEmpty()) {
+ throw new Exception("Version file does not contain a version")
+ }
+ versionFile.text.trim()
+}
diff --git a/build-logic/src/main/groovy/eu.geekplace.javapinning.javadoc-conventions.gradle b/build-logic/src/main/groovy/eu.geekplace.javapinning.javadoc-conventions.gradle
new file mode 100644
index 0000000..95fc0b4
--- /dev/null
+++ b/build-logic/src/main/groovy/eu.geekplace.javapinning.javadoc-conventions.gradle
@@ -0,0 +1,24 @@
+plugins {
+ // Javadoc linking requires repositories to bet configured. And
+ // those are declared in common-conventions, hence we add it here.
+ id 'eu.geekplace.javapinning.common-conventions'
+}
+
+
+tasks.withType(Javadoc) {
+ // The '-quiet' as second argument is actually a hack,
+ // since the one parameter addStringOption doesn't seem to
+ // work, we extra add '-quiet', which is added anyway by
+ // gradle.
+ // We disable 'missing' as we do most of javadoc checking via checkstyle.
+ options.addStringOption('Xdoclint:all,-missing', '-quiet')
+ // Abort on javadoc warnings.
+ // See JDK-8200363 (https://bugs.openjdk.java.net/browse/JDK-8200363)
+ // for information about the -Xwerror option.
+ options.addStringOption('Xwerror', '-quiet')
+ options.addStringOption('-release', javaMajor)
+}
+
+tasks.withType(Javadoc) {
+ options.charSet = "UTF-8"
+}
diff --git a/build-logic/src/main/groovy/eu.geekplace.javapinning.junit4-conventions.gradle b/build-logic/src/main/groovy/eu.geekplace.javapinning.junit4-conventions.gradle
new file mode 100644
index 0000000..ffdb90a
--- /dev/null
+++ b/build-logic/src/main/groovy/eu.geekplace.javapinning.junit4-conventions.gradle
@@ -0,0 +1,4 @@
+dependencies {
+ testImplementation "junit:junit:4.13.2"
+ testRuntimeOnly "org.junit.vintage:junit-vintage-engine:$junitVersion"
+}
diff --git a/build.gradle b/build.gradle
index 8482c29..2a67998 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,209 +1,59 @@
-buildscript {
- repositories {
- mavenCentral()
- jcenter()
- google()
- }
-
- dependencies {
- classpath 'com.android.tools.build:gradle:3.0.1'
- }
+plugins {
+ id 'eu.geekplace.javapinning.javadoc-conventions'
}
-apply from: 'version.gradle'
+// TODO:
+// apply from: 'version.gradle'
ext {
- gitCommit = getGitCommit()
- buildDate = getDatestamp()
- sonatypeCredentialsAvailable = project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')
- isReleaseVersion = !isSnapshot
- signingRequired = isReleaseVersion
- sonatypeSnapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
- sonatypeStagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
- // Returns only the date in yyyy-MM-dd format, as otherwise, with
- // hh:mm:ss information, the manifest files would change with every
- // build, causing unnecessary rebuilds.
- builtDate = (new java.text.SimpleDateFormat("yyyy-MM-dd")).format(new Date())
- oneLineDesc = 'A Java library for TLS pinning'
- androidProjects = [
- ':java-pinning-android'
- ].collect{ project(it) }
- javaProjects = subprojects - androidProjects
- javaCompatibility = JavaVersion.VERSION_1_7
- rootConfigDir = new File(rootDir, 'config')
-}
-
-configure(javaProjects) {
- apply plugin: 'java'
- apply plugin: 'eclipse'
- apply plugin: 'osgi'
- // We need to apply the 'maven' plugin here too, as otherwise the
- // dependencies of java-pinning-java7 won't be set correctly, e.g
- // the dependency on java-pinning won't be set.
- apply plugin: 'maven'
-
- sourceCompatibility = javaCompatibility
- targetCompatibility = sourceCompatibility
-
- eclipse {
- classpath {
- downloadJavadoc = true
+ javadocAllDir = new File(buildDir, 'javadoc')
+ noJavadocAllProjects = [
+ ':java-pinning-android',
+ ].collect { project(it) }
+ javadocAllProjects = subprojects - noJavadocAllProjects
+}
+
+
+evaluationDependsOnChildren()
+task javadocAll(type: Javadoc) {
+ source javadocAllProjects.collect {project ->
+ project.sourceSets.main.allJava.findAll {
+ // Filter out symbolic links to avoid
+ // "warning: a package-info.java file has already been seen for package"
+ // javadoc warnings.
+ !java.nio.file.Files.isSymbolicLink(it.toPath())
}
}
-
- task sourcesJar(type: Jar, dependsOn: classes) {
- classifier = 'sources'
- from sourceSets.main.allSource
- }
-
- task javadocJar(type: Jar, dependsOn: javadoc) {
- classifier = 'javadoc'
- from javadoc.destinationDir
- }
-
- artifacts {
- archives sourcesJar
- archives javadocJar
- }
-
- uploadArchives {
- repositories {
- mavenDeployer {
- pom {
- project {
- packaging 'jar'
- }
+ destinationDir = javadocAllDir
+ // Might need a classpath
+ classpath = files(javadocAllProjects.collect {project ->
+ project.sourceSets.main.compileClasspath})
+ classpath += files(androidBootClasspath)
+ options {
+ linkSource = true
+ use = true
+ links = [
+ "https://docs.oracle.com/en/java/javase/${javaMajor}/docs/api/",
+ ] as String[]
+ overview = "$projectDir/resources/javadoc-overview.html"
+ }
+
+ // Finally copy the javadoc doc-files from the subprojects, which
+ // are potentially generated, to the javadocAll directory. Note
+ // that we use a copy *method* and not a *task* because the inputs
+ // of copy tasks is determined within the configuration phase. And
+ // since some of the inputs are generated, they will not get
+ // picked up if we used a copy method. See also
+ // https://stackoverflow.com/a/40518516/194894
+ doLast {
+ copy {
+ javadocAllProjects.each {
+ from ("${it.projectDir}/src/javadoc") {
+ include '**/doc-files/*.*'
}
}
- }
- }
-
- jar {
- manifest {
- attributes(
- 'Implementation-Version': version,
- 'Implementation-GitRevision': project.gitCommit,
- 'Built-Date': project.buildDate,
- 'Built-JDK': System.getProperty('java.version'),
- 'Built-Gradle': gradle.gradleVersion,
- 'Built-By': System.getProperty('user.name')
- )
- }
- }
-}
-
-allprojects {
- apply plugin: 'idea'
- group = 'eu.geekplace.javapinning'
- version = shortVersion
- if (isSnapshot) {
- version += '-SNAPSHOT'
- }
- if (JavaVersion.current().isJava8Compatible()) {
- tasks.withType(Javadoc) {
- options.addStringOption('Xdoclint:none', '-quiet')
+ into javadocAllDir
}
}
-
-}
-
-subprojects {
- apply plugin: 'maven'
- apply plugin: 'signing'
- apply plugin: 'checkstyle'
-
- repositories {
- mavenCentral()
- }
-
- uploadArchives {
- repositories {
- mavenDeployer {
- if (signingRequired) {
- beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
- }
- repository(url: project.sonatypeStagingUrl) {
- if (sonatypeCredentialsAvailable) {
- authentication(userName: sonatypeUsername, password: sonatypePassword)
- }
- }
- snapshotRepository(url: project.sonatypeSnapshotUrl) {
- if (sonatypeCredentialsAvailable) {
- authentication(userName: sonatypeUsername, password: sonatypePassword)
- }
- }
-
- pom.project {
- name 'Java Pinning'
- description project.oneLineDesc
- url 'http://javapinning.geekplace.eu'
-
- scm {
- url 'https://github.com/flowdalic/android-pinning'
- connection 'scm:git@github.com:flowdalic/android-pinning.git'
- developerConnection 'scm:git@github.com:flowdalic/android-pinning.git'
- }
-
- licenses {
- license {
- name 'The Apache Software License, Version 2.0'
- url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
- distribution 'repo'
- }
- }
-
- developers {
- developer {
- id 'flow'
- name 'Florian Schmaus'
- }
- }
- }
- }
- }
- }
-
- signing {
- required { signingRequired }
- sign configurations.archives
- }
-
- checkstyle {
- configFile = new File(rootConfigDir, 'checkstyle.xml')
- toolVersion = '7.7'
- }
-}
-
-gradle.taskGraph.whenReady { taskGraph ->
- if (signingRequired
- && taskGraph.allTasks.any { it instanceof Sign }) {
- // Use Java 6's console to read from the console (no good for a CI environment)
- def console = System.console()
- console.printf '\n\nWe have to sign some things in this build.\n\nPlease enter your signing details.\n\n'
- def password = console.readPassword('GnuPG Private Key Password: ')
-
- allprojects { ext.'signing.password' = password }
-
- console.printf '\nThanks.\n\n'
- }
-}
-
-def getGitCommit() {
- def dotGit = new File("$projectDir/.git")
- if (!dotGit.isDirectory()) return 'non-git build'
-
- def cmd = 'git describe --always --tags --dirty=+'
- def proc = cmd.execute()
- def gitCommit = proc.text.trim()
- assert !gitCommit.isEmpty()
- gitCommit
-}
-
-// Returns only the date in yyyy-MM-dd format, as otherwise, with
-// hh:mm:ss information, the manifest files would change with every
-// build, causing unnecessary rebuilds.
-def getDatestamp() {
- def date = new Date()
- return date.format('yyyy-MM-dd')
}
diff --git a/config/checkstyle.xml b/config/checkstyle/checkstyle.xml
similarity index 87%
rename from config/checkstyle.xml
rename to config/checkstyle/checkstyle.xml
index 23156f8..0ff9b31 100644
--- a/config/checkstyle.xml
+++ b/config/checkstyle/checkstyle.xml
@@ -4,11 +4,10 @@
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
- * The Pin String must be in the format [type]:[hex-string], where
- * type denotes the type of the Pin and hex-string is the
+ * The Pin String must be in the format [type]:[hex-string]
, where
+ * type
denotes the type of the Pin and hex-string
is the
* binary value of the Pin encoded in hex. Currently supported types are
*
*