diff --git a/datacapture/build.gradle.kts b/datacapture/build.gradle.kts index 1b274ead1e..7969d8828a 100644 --- a/datacapture/build.gradle.kts +++ b/datacapture/build.gradle.kts @@ -4,24 +4,21 @@ plugins { id(Plugins.BuildPlugins.mavenPublish) } -val group = "com.google.android.fhir" -val version = "0.1.0-alpha02" - -tasks { - val sourcesJar by creating(Jar::class) { - archiveClassifier.set("sources") - from(android.sourceSets.getByName("main").java.srcDirs) - } - artifacts { add("archives", sourcesJar) } -} - afterEvaluate { publishing { publications { register("release", MavenPublication::class) { from(components["release"]) artifactId = "data-capture" - // Also publish source code for developers" convenience + groupId = "com.google.android.fhir" + version = "0.1.0-alpha02" + // Also publish source code for developers' convenience + artifact( + tasks.create("androidSourcesJar") { + archiveClassifier.set("sources") + from(android.sourceSets.getByName("main").java.srcDirs) + } + ) pom { name.set("Android FHIR Structured Data Capture Library") licenses { diff --git a/engine/build.gradle.kts b/engine/build.gradle.kts index 0bf7480358..fd9ec6762f 100644 --- a/engine/build.gradle.kts +++ b/engine/build.gradle.kts @@ -5,18 +5,21 @@ plugins { id(Plugins.BuildPlugins.mavenPublish) } -val artifactGroup = "com.google.android.fhir" -val artifactVersion = "0.1.0-alpha01" - afterEvaluate { publishing { publications { register("release", MavenPublication::class) { from(components["release"]) artifactId = "engine" - groupId = artifactGroup - version = artifactVersion - // Also publish source code for developers" convenience + groupId = "com.google.android.fhir" + version = "0.1.0-alpha01" + // Also publish source code for developers' convenience + artifact( + tasks.create("androidSourcesJar") { + archiveClassifier.set("sources") + from(android.sourceSets.getByName("main").java.srcDirs) + } + ) pom { name.set("Android FHIR Engine Library") licenses {