File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ plugins {
66}
77
88mavenPublishing {
9- coordinates(" io.github.petterpx" , " floatingx" , versionName )
9+ coordinates(" io.github.petterpx" , " floatingx" , version_name )
1010}
1111
1212android {
@@ -18,8 +18,8 @@ android {
1818 defaultConfig {
1919 minSdk minsdk_version
2020 targetSdk targetsdk_version
21- versionCode android . versionCode
22- versionName android . versionName
21+ versionCode version_code
22+ versionName version_name
2323 consumerProguardFiles " proguard-floatingx.pro"
2424 }
2525
Original file line number Diff line number Diff line change @@ -6,19 +6,18 @@ plugins {
66}
77
88mavenPublishing {
9- coordinates(" io.github.petterpx" , " floatingx-compose" , versionName )
9+ coordinates(" io.github.petterpx" , " floatingx-compose" , version_name )
1010}
1111
1212android {
1313 namespace ' com.petterp.floatingx.compose'
1414
1515 compileSdk compilesdk_version
16- def android = rootProject. ext
1716 defaultConfig {
1817 minSdk minsdk_version
1918 targetSdk targetsdk_version
20- versionCode android . versionCode
21- versionName android . versionName
19+ versionCode version_code
20+ versionName version_name
2221 consumerProguardFiles " proguard-floatingx-compose.pro"
2322 }
2423
Original file line number Diff line number Diff line change 33 minsdk_version = 21
44 targetsdk_version = 31
55 compilesdk_version = 31
6+ version_code = gitVersionCode()
7+ version_name = gitVersionTag()
68}
9+
10+ static def gitVersionTag () {
11+ def commit = ' git rev-list --tags --max-count=1'
12+ def cmd = " git describe --tags ${ commit.execute().text} "
13+ def version = cmd. execute(). text. trim()
14+ return version
15+ }
16+
17+ static def gitVersionCode () {
18+ def cmd = ' git rev-list HEAD --count'
19+ return cmd. execute(). text. trim(). toInteger()
20+ }
21+
22+
23+ println ' ------Fx---->'
24+ println (" isDev-> $ext . isDev " )
25+ println (" isPublish-> $ext . isPublish " )
26+ println (" versionCode-> $ext . version_code " )
27+ println (" versionName-> $ext . version_name " )
28+ println " ------Fx-end----->"
Original file line number Diff line number Diff line change @@ -36,26 +36,4 @@ gradle.projectsLoaded { project ->
3636
3737 rootProjectExt. isDev = localProperties. getProperty(" isDev" , " true" ). toBoolean()
3838 rootProjectExt. isPublish = rootProject. findProperty(" isPublish" ) ?: false
39- rootProjectExt. versionCode = gitVersionCode()
40- rootProjectExt. versionName = gitVersionTag()
41-
42- println ' ------Fx---->'
43- println (" isDev-> $rootProjectExt . isDev " )
44- println (" isPublish-> $rootProjectExt . isPublish " )
45- println (" versionCode-> $rootProjectExt . versionCode " )
46- println (" versionName-> $rootProjectExt . versionName " )
47- println " ------Fx-end----->"
48- }
49-
50-
51- static def gitVersionTag () {
52- def commit = ' git rev-list --tags --max-count=1'
53- def cmd = " git describe --tags ${ commit.execute().text} "
54- def version = cmd. execute(). text. trim()
55- return version
56- }
57-
58- static def gitVersionCode () {
59- def cmd = ' git rev-list HEAD --count'
60- return cmd. execute(). text. trim(). toInteger()
6139}
You can’t perform that action at this time.
0 commit comments