-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to AndroidX, gradle version and plugin updates #357
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
c996863
Update to AndroidX, gradle version and plugin updates
ekigamba eec17d4
Change CI Java version to 11
ekigamba db7770e
Fix compileOptions.sourceCompatibility and targetCompatibility to Jav…
ekigamba 89b3374
Prevent jetifying the shadows.jar
ekigamba 0119151
Update Robolectric to 4.3.1
ekigamba 81a4a74
Fix and update tests
ekigamba e632dc9
Exclude 'net.sf.kxml:kxml2' from espresso import
ekigamba 7a8fd40
Add multi-dex for wrapper module
ekigamba 55f286f
Update tests in (andoidTest)KujakuMapViewTest
ekigamba 15f8c42
Fix NoClassDefFoundError in sample module
ekigamba ecb5a89
Fix NoClassDefFoundError in library and wrapper module
ekigamba a1ca3cc
Add jacocoFullReport task
ekigamba ab02d0e
Draft: Fix jacoco merge report capability
ekigamba 1530439
Fix Jacoco coverage and JacocoFullCoverage tasks
ekigamba db2a14b
Run instrumented tests before jacoco test report
ekigamba 7dd6d66
Update Mapbox SDK to 9.7.1 and move common gradle methods to configs.…
ekigamba 8335276
Add Mapbox repo token for CI build
ekigamba b22a1ed
Update AGP to 7.1.3 and gradle wrapper to 7.2
ekigamba 40149c0
Downgrade Mockito because of missing Optional class
ekigamba 82ed7c2
Add mockito-core for instrumented tests
ekigamba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,7 @@ | |
|
||
**/jacoco.exec | ||
**/*-journal | ||
|
||
# Robolectric dependencies | ||
robolectric-deps/ | ||
**/robolectric-deps.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
|
||
ant.condition(property: 'os', value: 'windows') { | ||
os(family: 'windows') | ||
} | ||
ant.condition(property: 'os', value: 'unix') { | ||
os(family: 'unix') | ||
} | ||
|
||
// Based on http://stackoverflow.com/questions/17097263#24121734 | ||
def getMasterCommitCount = { -> | ||
try { | ||
def stdout = new ByteArrayOutputStream() | ||
exec { | ||
switch (ant.properties.os) { | ||
case 'windows': | ||
commandLine 'cmd', '/c', 'git', 'rev-list', '--first-parent', '--count', 'master' | ||
break | ||
case 'unix': | ||
commandLine 'git', 'rev-list', '--first-parent', '--count', 'origin/master' | ||
break | ||
} | ||
standardOutput = stdout | ||
} | ||
return Integer.parseInt(stdout.toString().trim()) | ||
} catch (ignored) { | ||
return -1 | ||
} | ||
} | ||
|
||
def getVersionName = { -> | ||
try { | ||
def stdout = new ByteArrayOutputStream() | ||
exec { | ||
switch (ant.properties.os) { | ||
case 'windows': | ||
commandLine 'cmd', '/c', 'git', 'describe', '--tags', '--dirty', '--always' | ||
break | ||
case 'unix': | ||
commandLine 'git', 'describe', '--tags', '--dirty', '--always' | ||
break | ||
} | ||
standardOutput = stdout | ||
} | ||
return stdout.toString().trim() | ||
} catch (ignored) { | ||
return null | ||
} | ||
} | ||
|
||
ext.getMasterCommitCount = getMasterCommitCount | ||
ext.getVersionName = getVersionName | ||
|
||
|
||
// LOAD PROPERTIES FILE | ||
Properties properties = new Properties() | ||
String[] propertyKeys = ["cgr.username", "cgr.password", "cgr.url", "mapbox.sdk.token", "mapbox.repo.token"] | ||
|
||
|
||
if (project.rootProject.file("local.properties").exists()) { | ||
properties.load(project.rootProject.file("local.properties").newDataInputStream()) | ||
|
||
if (properties != null) { | ||
boolean containsAllKeys = true | ||
ArrayList<String> missingKeys = new ArrayList<>() | ||
|
||
for (String propertyKey: propertyKeys) { | ||
if (!properties.containsKey(propertyKey)) { | ||
missingKeys.add(propertyKey) | ||
containsAllKeys = false | ||
} | ||
} | ||
|
||
if (!containsAllKeys) { | ||
println(("One of the required config variables is not set in your local.properties. Make sure you have " + missingKeys.join(", "))) | ||
} | ||
} else { | ||
println("Properties was null!! The file does not exist or contains nothing") | ||
} | ||
} else { | ||
println("local.properties does not exist") | ||
} | ||
|
||
if (properties == null) { | ||
properties = new Properties() | ||
} | ||
|
||
for (String propertyKey: propertyKeys) { | ||
if (!properties.containsKey(propertyKey)) { | ||
properties.put(propertyKey, "\"\"") | ||
} | ||
} | ||
|
||
ext.localProperties = properties | ||
|
||
|
||
/** | ||
|
||
Dependencies | ||
|
||
|
||
*/ | ||
|
||
ext { | ||
|
||
// Dependency and other versions | ||
androidxTestCoreVersion = "1.4.0" | ||
buildToolsVersion = "30.0.3" | ||
compileSdkVersion = 28 | ||
jacocoVersion = "0.8.8" | ||
junitVersion = "4.12" | ||
mapboxAnnotationPluginVersion = "0.9.0" | ||
mapboxSdkVersion = "9.7.1" | ||
robolectricShadowsMultidexVersion = "4.3.1" | ||
robolectricVersion = "4.3.1" | ||
supportVersion = "1.0.0" | ||
volleyVersion = "1.2.0" | ||
targetSdkVersion = 27 | ||
|
||
// Dependency names | ||
androidxTestCore = "androidx.test:core:$androidxTestCoreVersion" | ||
junit = "junit:junit:$junitVersion" | ||
mapboxSDK = "com.mapbox.mapboxsdk:mapbox-android-sdk:$mapboxSdkVersion" | ||
mapboxSDKTurf = "com.mapbox.mapboxsdk:mapbox-sdk-turf:4.8.0" | ||
mapboxAnnotationPlugin = "com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:$mapboxAnnotationPluginVersion" | ||
robolectric = "org.robolectric:robolectric:$robolectricVersion" | ||
robolectricShadowsMultidex = "org.robolectric:shadows-multidex:$robolectricShadowsMultidexVersion" | ||
} | ||
|
||
|
||
//ext.mapboxSDK = "com.mapbox.maps:android:10.7.0" | ||
|
||
ext.mapboxDependencies = { instance, configuration -> | ||
|
||
configuration.implementation("com.mapbox.maps:android:$mapboxSdkVersion") { | ||
transitive = true; | ||
exclude group: 'com.android.support', module: 'support-v4' | ||
exclude group: 'com.android.support', module: 'support-annotations' | ||
exclude group: 'com.android.support', module: 'support-fragment' | ||
} | ||
|
||
|
||
// The local build has an issue fetching this library for some reason which | ||
// is a dependency of the mapbox-android-sdk. The mapbox-sdk-turf is declared as | ||
// a runtime dependency | ||
configuration.implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:4.8.0' | ||
configuration.implementation "com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v7:${instance.mapboxAnnotationPluginVersion}" | ||
|
||
} | ||
|
||
//ext.mapboxDependencies = mapboxDependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
mkdir robolectric-deps | ||
wget -nc https://repo1.maven.org/maven2/org/robolectric/android-all/10-robolectric-5803371/android-all-10-robolectric-5803371.jar -P robolectric-deps | ||
wget -nc https://repo1.maven.org/maven2/org/robolectric/android-all/8.1.0-robolectric-4611349/android-all-8.1.0-robolectric-4611349.jar -P robolectric-deps | ||
wget -nc https://repo1.maven.org/maven2/org/robolectric/android-all/8.0.0_r4-robolectric-r1/android-all-8.0.0_r4-robolectric-r1.jar -P robolectric-deps | ||
|
||
wget -nc https://repo1.maven.org/maven2/org/robolectric/android-all/6.0.1_r3-robolectric-r1/android-all-6.0.1_r3-robolectric-r1.jar -P robolectric-deps | ||
wget -nc https://repo1.maven.org/maven2/org/robolectric/android-all/7.0.0_r1-robolectric-r1/android-all-7.0.0_r1-robolectric-r1.jar -P robolectric-deps | ||
wget -nc https://repo1.maven.org/maven2/org/robolectric/android-all/7.1.0_r7-robolectric-r1/android-all-7.1.0_r7-robolectric-r1.jar -P robolectric-deps | ||
wget -nc https://repo1.maven.org/maven2/org/robolectric/android-all/9-robolectric-4913185-2/android-all-9-robolectric-4913185-2.jar -P robolectric-deps | ||
wget -nc https://repo1.maven.org/maven2/org/robolectric/android-all/11-robolectric-6757853/android-all-11-robolectric-6757853.jar -P robolectric-deps | ||
|
||
cp robolectric-deps.properties library/src/test/resources | ||
cp robolectric-deps.properties utils/src/test/resources | ||
cp robolectric-deps.properties sample/src/test/resources | ||
cp robolectric-deps.properties wrapper/src/test/resources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Thu Feb 28 14:26:07 CET 2019 | ||
#Sun Aug 21 19:58:31 EAT 2022 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip | ||
zipStoreBase=GRADLE_USER_HOME |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to bump up the artefact version for tagging on git and publishing the snapshot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can do that here but I prefer to have this on separate PRs for better tracking since releases were not always done after every PR https://github.com/onaio/kujaku/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Aclosed+release