Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
AndroidUtils
VPNTunnelProxy
Commits
70bb7152
Commit
70bb7152
authored
Aug 19, 2021
by
Daniel Wolf
Browse files
Merge branch 'master' of
https://git.frostnerd.com/AndroidUtils/baselibrarykt
parents
aa7d98de
dbb292cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
70bb7152
...
...
@@ -7,4 +7,6 @@ test-build-deploy:
stage
:
test
script
:
-
./gradlew clean assembleRelease sourcesJar test --stacktrace
-
./gradlew publish --stacktrace
\ No newline at end of file
-
./gradlew publish --stacktrace
only
:
-
/^v([0-9]+\.?)+[0-9]$/
\ No newline at end of file
library/build.gradle
View file @
70bb7152
...
...
@@ -3,10 +3,21 @@ apply plugin: 'kotlin-android'
apply
plugin:
'kotlin-android-extensions'
group
=
'com.frostnerd.utilskt'
version
=
'3.1.17'
ext
{
libraryGroupId
=
group
libraryArtifactId
=
rootProject
.
name
libraryVersion
=
'3.1.17'
}
task
bumpPatch
()
{
dependsOn
(
"bumpPatchVersion"
)
}
task
bumpMinor
()
{
dependsOn
(
"bumpMinorVersion"
)
}
task
bumpMajor
()
{
dependsOn
(
"bumpMajorVersion"
)
}
android
{
...
...
@@ -49,7 +60,7 @@ android {
exclude
'META-INF/ASL2.0'
}
compileOptions
{
kotlinOptions
.
freeCompilerArgs
+=
[
'-module-name'
,
"$
libraryG
roup
Id
.$libraryArtifactId"
]
kotlinOptions
.
freeCompilerArgs
+=
[
'-module-name'
,
"$
g
roup.$libraryArtifactId"
]
}
}
...
...
@@ -79,12 +90,13 @@ task sourcesJar(type: Jar) {
classifier
=
'sources'
}
afterEvaluate
{
publishing
{
publications
{
aar
(
MavenPublication
)
{
groupId
libraryG
roup
Id
version
libraryV
ersion
groupId
g
roup
version
v
ersion
artifactId
libraryArtifactId
artifact
(
"$buildDir/outputs/aar/library-release.aar"
)
...
...
@@ -117,4 +129,67 @@ afterEvaluate {
}
}
}
publish
.
dependsOn
(
"assembleRelease"
,
"sourcesJar"
)
\ No newline at end of file
publish
.
dependsOn
(
"assembleRelease"
,
"sourcesJar"
)
class
Version
{
private
int
major
private
int
minor
private
int
patch
Version
(
String
version
)
{
def
(
major
,
minor
,
patch
)
=
version
.
tokenize
(
'.'
)
this
.
major
=
major
.
toInteger
()
this
.
minor
=
minor
.
toInteger
()
this
.
patch
=
patch
.
toInteger
()
}
void
bumpMajor
()
{
major
+=
1
minor
=
0
patch
=
0
}
void
bumpMinor
()
{
minor
+=
1
patch
=
0
}
void
bumpPatch
()
{
patch
+=
1
}
String
getName
()
{
"$major.$minor.$patch"
}
}
tasks
.
addRule
(
"Pattern: bump<TYPE>Version"
)
{
String
taskName
->
if
(
taskName
.
matches
(
"bump(Major|Minor|Patch)Version"
))
{
task
(
taskName
)
{
doLast
{
String
type
=
(
taskName
-
'bump'
-
'Version'
)
println
"Bumping ${type.toLowerCase()} version"
def
parsedVersion
=
new
Version
(
version
)
parsedVersion
.
"bump$type"
()
println
"${version} => ${parsedVersion.name}"
def
updated
=
buildFile
.
getText
()
updated
=
updated
.
replaceFirst
(
"version\\s*=\\s*'$version'"
,
"version = '${parsedVersion.name}'"
)
buildFile
.
setText
(
updated
)
exec
{
commandLine
(
"git"
,
"add"
,
"build.gradle"
)
}
exec
{
commandLine
(
"git"
,
"commit"
,
"-m"
,
"\"Bump version to ${parsedVersion.name}\""
)
}
exec
{
commandLine
(
"git"
,
"tag"
,
"v${parsedVersion.name}"
)
}
exec
{
commandLine
(
"git"
,
"push"
,
"origin"
,
"v${parsedVersion.name}"
)
}
}
}
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment