config/android-maven-publication.gradle
changeset 1 831cffa9c991
child 6 99ad8c14fec2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/android-maven-publication.gradle	Fri May 08 21:33:19 2020 -0400
@@ -0,0 +1,30 @@
+/**
+ * This configuration allows to publish android libraries into a maven repository.
+ * You need to define in your build.gradle the following variables :
+ * version = "1.0"                // the version of your projects
+ * ext.artifactId="geny-widgets"  // the maven artifact id
+ * Use ./gradlew tasks to see the name of the publishing tasks.
+ */
+if (plugins.hasPlugin("com.android.library")) {
+
+    apply plugin: 'maven-publish'
+
+    if (!project.ext.properties.containsKey("artifactId")) {
+        ext.artifactId = project.name
+    }
+
+    publishing {
+        publications {
+            projectRelease(MavenPublication) {
+                artifactId project.artifactId
+                artifact "build/outputs/aar/${project.archivesBaseName}-release.aar"
+            }
+
+            projectSnapshot(MavenPublication) {
+                artifactId project.artifactId
+                artifact "build/outputs/aar/${project.archivesBaseName}-debug.aar"
+                version getVersion() + "-SNAPSHOT"
+            }
+        }
+    }
+}