Skip to content

Commit

Permalink
Merge pull request #58 from hannesa2/BumpGithubAppUpdate
Browse files Browse the repository at this point in the history
Bump githubAppUpdate
  • Loading branch information
hannesa2 committed Mar 25, 2021
2 parents 16b6cf5 + 2cb0bf1 commit cf96612
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
15 changes: 2 additions & 13 deletions app/build.gradle
Expand Up @@ -10,8 +10,7 @@ android {
targetSdkVersion 30
versionCode getGitCommitCount()
versionName getTag()
buildConfigField "String", 'GIT_USER', "\"" + getGitUser() + "\""
buildConfigField "String", 'GIT_REPOSITORY', "\"" + getGitRepository() + "\""
buildConfigField "String", 'GIT_REPOSITORY', "\"" + getGitOriginRemote() + "\""
buildConfigField "String", 'VERSION', "\"" + versionName + "\""

ndk {
Expand Down Expand Up @@ -69,7 +68,7 @@ dependencies {
implementation "androidx.core:core-ktx:1.3.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'com.github.hannesa2:githubAppUpdate:1.1'
implementation 'com.github.hannesa2:githubAppUpdate:1.2'

androidTestImplementation 'com.github.AppDevNext:Moka:0.4'
androidTestImplementation "androidx.test.ext:junit:1.1.2"
Expand All @@ -85,13 +84,3 @@ static def getGitOriginRemote() {
def found = values.find { it.startsWith("origin") && it.endsWith("(push)") }
return found.replace("origin", "").replace("(push)", "").replace(".git", "").trim()
}

static def getGitUser() {
def token = getGitOriginRemote().split("/")
return token[3]
}

static def getGitRepository() {
def token = getGitOriginRemote().split("/")
return token[4]
}
Expand Up @@ -16,7 +16,6 @@ class MedaipipeMainActivity : NavigationActivity() {

AppUpdateHelper.checkForNewVersion(
this,
BuildConfig.GIT_USER,
BuildConfig.GIT_REPOSITORY,
BuildConfig.VERSION_NAME
)
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/info/mediapipe/app/NavigationActivity.kt
Expand Up @@ -76,7 +76,6 @@ abstract class NavigationActivity : AppCompatActivity(), NavigationView.OnNaviga
R.id.action_update -> {
AppUpdateHelper.checkForNewVersion(
this,
BuildConfig.GIT_USER,
BuildConfig.GIT_REPOSITORY,
BuildConfig.VERSION_NAME)
true
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Expand Up @@ -23,6 +23,7 @@ task clean(type: Delete) {
delete rootProject.buildDir
}

@SuppressWarnings('unused')
static def getTag() {
// with local un-commited changes a -DIRTY is added
def processChanges = "git diff-index --name-only HEAD --".execute()
Expand Down

0 comments on commit cf96612

Please sign in to comment.