@@ -17,9 +17,47 @@ import org.gradle.plugins.signing.SigningExtension
1717
1818object MavenConfig {
1919
20- val VERSION = Version ( 1 , 22 , 0 , Version . Type . Snapshot )
21- const val GROUP_ID = " com.datadoghq "
20+ val VERSION = determineVersion( )
21+ const val GROUP_ID = " cloud.flashcat "
2222 const val PUBLICATION = " pluginMaven"
23+
24+ /* *
25+ * Determine version based on Git ref type and branch
26+ * - Tag (v*) → Release version (e.g., 1.0.0)
27+ * - publish branch → Snapshot version (e.g., 1.1.0-SNAPSHOT)
28+ * - Other → Local development version
29+ */
30+ private fun determineVersion (): Version {
31+ val refType = System .getenv(" GITHUB_REF_TYPE" )
32+ val refName = System .getenv(" GITHUB_REF_NAME" )
33+
34+ return when {
35+ // Tag release: v1.0.0 → 1.0.0
36+ refType == " tag" && refName?.startsWith(" v" ) == true -> {
37+ parseVersionFromTag(refName)
38+ }
39+ // publish branch → Snapshot
40+ refName == " publish" -> {
41+ Version (1 , 1 , 0 , Version .Type .Snapshot )
42+ }
43+ // Local development or other branches
44+ else -> {
45+ Version (1 , 0 , 0 , Version .Type .Release )
46+ }
47+ }
48+ }
49+
50+ private fun parseVersionFromTag (tag : String ): Version {
51+ val versionString = tag.removePrefix(" v" )
52+ val parts = versionString.split(" ." )
53+
54+ return Version (
55+ major = parts.getOrNull(0 )?.toIntOrNull() ? : 1 ,
56+ minor = parts.getOrNull(1 )?.toIntOrNull() ? : 0 ,
57+ hotfix = parts.getOrNull(2 )?.toIntOrNull() ? : 0 ,
58+ type = Version .Type .Release
59+ )
60+ }
2361}
2462
2563fun Project.publishingConfig (projectDescription : String ) {
@@ -64,7 +102,7 @@ fun Project.publishingConfig(projectDescription: String) {
64102 pom {
65103 name.set(projectName)
66104 description.set(projectDescription)
67- url.set(" https://github.com/DataDog/dd -sdk-android-gradle-plugin/" )
105+ url.set(" https://github.com/flashcatcloud/fc -sdk-android-gradle-plugin/" )
68106
69107 licenses {
70108 license {
@@ -73,25 +111,25 @@ fun Project.publishingConfig(projectDescription: String) {
73111 }
74112 }
75113 organization {
76- name.set(" Datadog " )
77- url.set(" https://www.datadoghq.com /" )
114+ name.set(" Flashcat " )
115+ url.set(" https://flashcat.cloud /" )
78116 }
79117 developers {
80118 developer {
81- name.set(" Datadog " )
82- email.set(" info@datadoghq.com " )
83- organization.set(" Datadog " )
84- organizationUrl.set(" https://www.datadoghq.com /" )
119+ name.set(" Flashcat " )
120+ email.set(" support@flashcat.cloud " )
121+ organization.set(" Flashcat " )
122+ organizationUrl.set(" https://flashcat.cloud /" )
85123 }
86124 }
87125
88126 scm {
89- url.set(" https://github.com/DataDog/dd -sdk-android-gradle-plugin/" )
127+ url.set(" https://github.com/flashcatcloud/fc -sdk-android-gradle-plugin/" )
90128 connection.set(
91- " scm:git:git@github.com:Datadog/dd -sdk-android-gradle-plugin.git"
129+ " scm:git:git@github.com:flashcatcloud/fc -sdk-android-gradle-plugin.git"
92130 )
93131 developerConnection.set(
94- " scm:git:git@github.com:Datadog/dd -sdk-android-gradle-plugin.git"
132+ " scm:git:git@github.com:flashcatcloud/fc -sdk-android-gradle-plugin.git"
95133 )
96134 }
97135 }
0 commit comments