Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
6
600SeriesAndroidUploader
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cgm
uploader
600SeriesAndroidUploader
Commits
cb9fe03b
Commit
cb9fe03b
authored
8 years ago
by
Volker Richert
Browse files
Options
Downloads
Patches
Plain Diff
branch name can be added to VERSION_NAME
parent
88b21396
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/build.gradle
+10
-9
10 additions, 9 deletions
app/build.gradle
with
10 additions
and
9 deletions
app/build.gradle
+
10
−
9
View file @
cb9fe03b
...
...
@@ -27,7 +27,7 @@ apply plugin: 'realm-android'
def
gitVersion
()
{
// current dir is <your proj>/app, so it's likely that all your git repo files are in the dir
// above.
ext
.
repo
=
Grgit
.
open
(
project
.
file
(
'..'
)
)
ext
.
repo
=
Grgit
.
open
()
// should result in the same value as running
// git tag -l | wc -l or git tag -l | grep -c ".*" -
...
...
@@ -36,14 +36,15 @@ def gitVersion() {
}
def
gitCommitId
()
{
//def process = ['sh', '-c', 'git tag -l | grep -c ".*" -'].execute().text.trim()
//return process.toInteger() + 1
//return 42
// current dir is <your proj>/app, so it's likely that all your git repo files are in the dir
// above.
ext
.
repo
=
Grgit
.
open
(
project
.
file
(
'..'
))
ext
.
repo
=
Grgit
.
open
()
return
ext
.
repo
.
log
().
first
().
id
.
substring
(
0
,
7
)
//+ " " + ext.repo.branch.current.name
}
return
ext
.
repo
.
log
().
first
().
id
.
substring
(
0
,
7
)
def
gitBranch
()
{
ext
.
repo
=
Grgit
.
open
()
return
ext
.
repo
.
branch
.
current
.
name
}
def
getBugfenderApiKey
()
{
...
...
@@ -66,7 +67,7 @@ android {
applicationId
"info.nightscout.android"
minSdkVersion
14
targetSdkVersion
23
versionName
project
.
properties
[
'version'
]
+
"/"
+
gitCommitId
()
versionName
project
.
properties
[
'version'
]
+
"/"
+
gitCommitId
()
// + " (" + gitBranch()+")"
versionCode
gitVersion
()
buildConfigField
"String"
,
"BUGFENDER_API_KEY"
,
getBugfenderApiKey
()
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment