diff --git a/buildSrc/src/main/kotlin/Releases.kt b/buildSrc/src/main/kotlin/Releases.kt new file mode 100644 index 0000000000..2305ae9265 --- /dev/null +++ b/buildSrc/src/main/kotlin/Releases.kt @@ -0,0 +1,64 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.gradle.api.publish.maven.MavenPom + +object Releases { + const val groupId = "com.google.android.fhir" + + // Libraries + + object Engine { + const val artifactId = "engine" + const val version = "0.1.0-alpha05" + const val name = "Android FHIR Engine Library" + } + + object DataCapture { + const val artifactId = "data-capture" + const val version = "0.1.0-beta01" + const val name = "Android FHIR Structured Data Capture Library" + } + + object Workflow { + const val artifactId = "workflow" + const val version = "0.1.0-alpha01" + const val name = "Android FHIR Workflow Library" + } + + // Demo apps + + object Demo { + const val applicationId = "com.google.android.fhir.demo" + const val versionCode = 1 + const val versionName = "1.0" + } + + object Catalog { + const val applicationId = "com.google.android.fhir.catalog" + const val versionCode = 1 + const val versionName = "1.0" + } + + fun MavenPom.useApache2License() { + licenses { + license { + name.set("The Apache License, Version 2.0") + url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") + } + } + } +} diff --git a/catalog/build.gradle.kts b/catalog/build.gradle.kts index ec338544cd..60f60ea22f 100644 --- a/catalog/build.gradle.kts +++ b/catalog/build.gradle.kts @@ -9,11 +9,11 @@ android { buildToolsVersion = Plugins.Versions.buildTools defaultConfig { - applicationId = "com.google.android.fhir.catalog" + applicationId = Releases.Catalog.applicationId minSdk = Sdk.minSdk targetSdk = Sdk.targetSdk - versionCode = 1 - versionName = "1.0" + versionCode = Releases.Catalog.versionCode + versionName = Releases.Catalog.versionName testInstrumentationRunner = Dependencies.androidJunitRunner // Required when setting minSdkVersion to 20 or lower diff --git a/catalog/src/main/res/values/strings.xml b/catalog/src/main/res/values/strings.xml index 2fde181453..6d7de39066 100644 --- a/catalog/src/main/res/values/strings.xml +++ b/catalog/src/main/res/values/strings.xml @@ -35,5 +35,5 @@ Paginated Review Read only - SDC Gallery + Structured data capture \n Catalog diff --git a/datacapture/build.gradle.kts b/datacapture/build.gradle.kts index a8bed3c4cc..e6042571b9 100644 --- a/datacapture/build.gradle.kts +++ b/datacapture/build.gradle.kts @@ -1,3 +1,5 @@ +import Releases.useApache2License + plugins { id(Plugins.BuildPlugins.androidLib) id(Plugins.BuildPlugins.kotlinAndroid) @@ -10,9 +12,9 @@ afterEvaluate { publications { register("release", MavenPublication::class) { from(components["release"]) - artifactId = "data-capture" - groupId = "com.google.android.fhir" - version = "0.1.0-beta01" + groupId = Releases.groupId + artifactId = Releases.DataCapture.artifactId + version = Releases.DataCapture.version // Also publish source code for developers' convenience artifact( tasks.create("androidSourcesJar") { @@ -21,13 +23,8 @@ afterEvaluate { } ) pom { - name.set("Android FHIR Structured Data Capture Library") - licenses { - license { - name.set("The Apache License, Version 2.0") - url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") - } - } + name.set(Releases.DataCapture.name) + useApache2License() } } } diff --git a/demo/build.gradle.kts b/demo/build.gradle.kts index ab63952cdc..4bae59eb17 100644 --- a/demo/build.gradle.kts +++ b/demo/build.gradle.kts @@ -8,11 +8,11 @@ plugins { android { compileSdk = Sdk.compileSdk defaultConfig { - applicationId = "com.google.android.fhir.demo" + applicationId = Releases.Demo.applicationId minSdk = Sdk.minSdk targetSdk = Sdk.targetSdk - versionCode = 1 - versionName = "1.0" + versionCode = Releases.Demo.versionCode + versionName = Releases.Demo.versionName testInstrumentationRunner = Dependencies.androidJunitRunner // Required when setting minSdkVersion to 20 or lower // See https://developer.android.com/studio/write/java8-support diff --git a/engine/build.gradle.kts b/engine/build.gradle.kts index f5a31120f1..f64ec29033 100644 --- a/engine/build.gradle.kts +++ b/engine/build.gradle.kts @@ -1,3 +1,5 @@ +import Releases.useApache2License + plugins { id(Plugins.BuildPlugins.androidLib) id(Plugins.BuildPlugins.kotlinAndroid) @@ -11,9 +13,9 @@ afterEvaluate { publications { register("release", MavenPublication::class) { from(components["release"]) - artifactId = "engine" - groupId = "com.google.android.fhir" - version = "0.1.0-alpha05" + groupId = Releases.groupId + artifactId = Releases.Engine.artifactId + version = Releases.Engine.version // Also publish source code for developers' convenience artifact( tasks.create("androidSourcesJar") { @@ -22,13 +24,8 @@ afterEvaluate { } ) pom { - name.set("Android FHIR Engine Library") - licenses { - license { - name.set("The Apache License, Version 2.0") - url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") - } - } + name.set(Releases.Engine.name) + useApache2License() } } } diff --git a/workflow/build.gradle.kts b/workflow/build.gradle.kts index 0ed230aa8a..99d001b7ee 100644 --- a/workflow/build.gradle.kts +++ b/workflow/build.gradle.kts @@ -1,3 +1,5 @@ +import Releases.useApache2License + plugins { id(Plugins.BuildPlugins.androidLib) id(Plugins.BuildPlugins.kotlinAndroid) @@ -10,9 +12,9 @@ afterEvaluate { publications { register("release", MavenPublication::class) { from(components["release"]) - artifactId = "workflow" - groupId = "com.google.android.fhir" - version = "0.1.0-alpha01" + groupId = Releases.groupId + artifactId = Releases.Workflow.artifactId + version = Releases.Workflow.version // Also publish source code for developers' convenience artifact( tasks.create("androidSourcesJar") { @@ -21,13 +23,8 @@ afterEvaluate { } ) pom { - name.set("Android FHIR Workflow Library") - licenses { - license { - name.set("The Apache License, Version 2.0") - url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") - } - } + name.set(Releases.Workflow.name) + useApache2License() } } }