diff --git a/cameraview/build.gradle.kts b/cameraview/build.gradle.kts index 3f11732b..af7e2f1d 100644 --- a/cameraview/build.gradle.kts +++ b/cameraview/build.gradle.kts @@ -1,5 +1,3 @@ -import org.jetbrains.kotlin.gradle.plugin.statistics.ReportStatisticsToElasticSearch.url - plugins { id("com.android.library") id("kotlin-android") @@ -24,12 +22,20 @@ android { } } +fun Project.getStringProperty(propertyName: String): String? { + val property = findProperty(propertyName) + return if(property is String) property else null +} + +group = "com.otaliastudios.cameraview" +version = getStringProperty("libraryVersion") ?: "unspecified" + publishing { publications { register("apkRelease") { - groupId = "com.otaliastudios.cameraview" - version = "1.0.0" - artifactId = "cameraview" + groupId = getStringProperty("groupId") + version = getStringProperty("libraryVersion") + artifactId = getStringProperty("artifactId") artifact("$buildDir/outputs/aar/${artifactId}-release.aar") } } @@ -42,11 +48,11 @@ artifactory { setRepoKey("android-artifacts") setUsername(System.getenv("ARTIFACTORY_USERNAME")) setPassword(System.getenv("ARTIFACTORY_PASSWORD")) - setMavenCompatible(true) } defaults { publications("apkRelease") + setPublishArtifacts(true) setPublishPom(false) } } diff --git a/gradle.properties b/gradle.properties index 9e6fce10..edaa62cc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,3 +17,7 @@ org.gradle.jvmargs=-Xmx1536m # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true + +libraryVersion=2.7.2 +artifactId=cameraview +groupId=com.otaliastudios.cameraview \ No newline at end of file