Skip to content

Commit

Permalink
[build] Fix publication of java-pinning-android
Browse files Browse the repository at this point in the history
The version and group property was not set, since it was declared in
java-conventions. Move it into common-conventions to make those
properties available in java-pinning-android.
  • Loading branch information
Flowdalic committed Nov 17, 2024
1 parent 6afde95 commit f82b75a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ repositories {
mavenLocal()
}

group = 'eu.geekplace.javapinning'

version readVersionFile()

def getAndroidRuntimeJar(androidApiLevel) {
def androidHome = getAndroidHome()
def androidJar = new File("$androidHome/platforms/android-${androidApiLevel}/android.jar")
Expand All @@ -37,3 +41,14 @@ def getAndroidHome() {
if (!androidHome.isDirectory()) throw new Exception("Environment variable ANDROID_HOME is not pointing to a directory")
return androidHome
}

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()
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ plugins {
id 'eu.geekplace.javapinning.publish-conventions'
}

version readVersionFile()

ext {
gitCommit = getGitCommit()
documentationDir = new File(projectDir, 'documentation')
Expand All @@ -28,8 +26,6 @@ ext {
junitVersion = '5.11.3'
}

group = 'eu.geekplace.javapinning'

java {
sourceCompatibility = javaVersion
targetCompatibility = sourceCompatibility
Expand Down Expand Up @@ -186,14 +182,3 @@ def getGitCommit() {
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()
}
3 changes: 3 additions & 0 deletions java-pinning-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ plugins {
id 'com.android.library'
}

description = """\
Java Pinning's API for Android (min SDK level ${minAndroidSdk}"""

android {
compileSdkVersion 30

Expand Down

0 comments on commit f82b75a

Please sign in to comment.