Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ captures/
.idea/libraries
.idea/caches
.idea/codeStyles
.idea/modules.xml
.idea/misc.xml
.idea/jarRepositories.xml

# Keystore files
*.jks
Expand Down
14 changes: 0 additions & 14 deletions .idea/misc.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/modules.xml

This file was deleted.

12 changes: 5 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,19 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlinVersion = '1.3.40'
ext.kotlinVersion = '1.4.10'

repositories {
google()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
mavenCentral()
maven {url "https://plugins.gradle.org/m2/"}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "com.github.dcendents:android-maven-gradle-plugin:2.1"
classpath "com.gladed.androidgitversion:gradle-android-git-version:0.4.9"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "com.gladed.androidgitversion:gradle-android-git-version:0.4.13"
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jun 17 11:03:52 CEST 2019
#Thu Sep 24 17:32:09 CEST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
32 changes: 19 additions & 13 deletions lib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
apply plugin: 'com.android.library'
apply plugin: "com.gladed.androidgitversion"

apply plugin: 'com.gladed.androidgitversion'
androidGitVersion {
codeFormat "MMNNPP"
format '%tag%'
tagPattern(/^[0-9]+.*/) // Tag names should follow the pattern MM.NN.PP
}

android {
compileSdkVersion project.ext.compileSdkVersion
compileSdkVersion 30

defaultConfig {
minSdkVersion project.ext.minSdkVersion
targetSdkVersion project.ext.targetSdkVersion
versionCode 1
minSdkVersion 21
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about doesnt couple example app with the lib? @adriangl

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean the minSdkVersion, or the app's versionCode?

If it's the former, you could update the ones in the root's build.gradle, which currently point to API 29 and use them here as well as in app.

If it's the latter, I'd keep app's versionCode to 1 for a very simple reason: so we always have the lowest version code available to test the in-app updates there :P

If you meant anything else, I didn't get it xD

Copy link
Contributor Author

@danielceinos danielceinos Sep 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was talking only about lib gradle file. Its a bit awkward need to look at the example app to get what minSdk version the library has, do you understand why I mean?

I'm OK with has versionCode to 1 at app's gradle.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. Yeah, we can leave the versions decoupled ;)

targetSdkVersion 30
versionName androidGitVersion.name()
versionCode androidGitVersion.code()

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -25,16 +30,17 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api "androidx.annotation:annotation:1.1.0"
api "androidx.appcompat:appcompat:1.0.2"

implementation "androidx.annotation:annotation:1.1.0"
implementation 'androidx.appcompat:appcompat:1.2.0'

// Needed for the in-app updates API
api "com.google.android.play:core:1.6.1"
api "com.google.android.play:core:1.8.0"

testImplementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.13'

androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

/*
Expand All @@ -56,7 +62,7 @@ dependencies {
// Build a jar with source files
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
archiveClassifier.set("sources")
}

// Build JavaDoc from source files
Expand All @@ -69,7 +75,7 @@ task javadoc(type: Javadoc) {

// Build a jar with JavaDoc
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
archiveClassifier.set("javadoc")
from javadoc.destinationDir
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,6 @@ public void setUpdateAvailable(int availableVersionCode) {
fakeAppUpdateManager.setUpdateAvailable(availableVersionCode);
}

/**
* Returns which type of update is partially allowed or null if no update is partially allowed.
*/
@Nullable
public Integer getPartiallyAllowedUpdateType() {
return fakeAppUpdateManager.getPartiallyAllowedUpdateType();
}

/**
* In case the update is only partially allowed, which means that not all in-app update types are allowed by policy,
* the type of update which is exclusively allowed can be set here.
* <p>
* Also sets the error code to {@link InstallErrorCode.NO_ERROR_PARTIALLY_ALLOWED} to enable the partial error behaviour.
*
* @param allowedUpdate one of {@link AppUpdateType.FLEXIBLE} or {@link AppUpdateType.IMMEDIATE}, or null
*/
public void setPartiallyAllowedUpdateType(@Nullable @AppUpdateType Integer allowedUpdate) {
fakeAppUpdateManager.setPartiallyAllowedUpdateType(allowedUpdate);
}

/**
* Declares that no updates are available.
*/
Expand Down