Skip to content

Commit

Permalink
Merge pull request #76 from ngageoint/develop
Browse files Browse the repository at this point in the history
Update pindrop branch w/ develop
  • Loading branch information
jclark118 authored Nov 28, 2023
2 parents 5a15a7c + a2f45a9 commit 2a4bc3c
Show file tree
Hide file tree
Showing 26 changed files with 599 additions and 684 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ jobs:
with:
java-version: 16
distribution: 'adopt'
- name: Setup Keystore
run: |
echo "${{ secrets.SIGNING_KEY }}" > release.b64
base64 -d release.b64 > release.keystore
- name: mobsfscan
uses: MobSF/mobsfscan@0.2.0
with:
Expand All @@ -24,21 +28,20 @@ jobs:
with:
sarif_file: results.sarif
- name: Build with Gradle
run: ./gradlew assembleRelease -PRELEASE_MAPS_MAPCACHE_API_KEY=${{ secrets.RELEASE_MAPS_MAPCACHE_API_KEY }}
- name: Sign APK
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: mapcache/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Copy Release Artifacts
run: |
mkdir mapcache/build/release
cp mapcache/build/outputs/apk/release/mapcache-*-signed.apk "mapcache/build/release/mapcache-$(./gradlew mapcache:androidAppVersion | grep versionName | sed 's/^.*@//').apk"
./gradlew clean assembleRelease \
-PKEYSTORE=../release.keystore \
-PKEYSTORE_PASSWORD=${{ secrets.KEY_STORE_PASSWORD }} \
-PKEY_ALIAS=${{ secrets.ALIAS }} \
-PKEY_PASSWORD=${{ secrets.KEY_PASSWORD }} \
-PRELEASE_MAPS_MAPCACHE_API_KEY=${{ secrets.RELEASE_MAPS_MAPCACHE_API_KEY }}
- name: Verify Signature
run: $ANDROID_SDK_ROOT/build-tools/33.0.1/apksigner verify --print-certs mapcache/build/outputs/apk/release/mapcache.apk
- name: List files in the repository
run: |
ls -R ${{ github.workspace }}
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: mapcache
path: mapcache/build/release
path: mapcache/build/outputs/apk/release/mapcache.apk
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.7.10'
ext.kotlin_version = '1.8.0'

repositories {
google()
Expand Down
75 changes: 44 additions & 31 deletions mapcache/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,51 @@ def googleMapsApiReleaseKey = hasProperty('RELEASE_MAPS_MAPCACHE_API_KEY') ? REL
def googleMapsApiKeyDebug = hasProperty('DEBUG_MAPS_API_KEY') ? DEBUG_MAPS_API_KEY : ''

android {
compileSdkVersion 31
compileSdkVersion 34

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

// Verbose logging for debug
// allprojects {
// tasks.withType(JavaCompile) {
// options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
// }
// }
defaultConfig {
applicationId "mil.nga.mapcache"
resValue "string", "applicationId", applicationId
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
minSdkVersion 28
targetSdkVersion 31
versionCode 53
versionName '2.1.7'
targetSdkVersion 34
versionCode 60
versionName '2.1.11'
multiDexEnabled true
}
signingConfigs {
release {
if (project.hasProperty('KEYSTORE')) {
println 'assigning keystore'
storeFile file(KEYSTORE)
storePassword KEYSTORE_PASSWORD
keyAlias KEY_ALIAS
keyPassword KEY_PASSWORD
} else {
println 'no keystore property configured'
}
}
}
buildTypes {
release {
applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "mapcache.apk"
}
}
minifyEnabled false
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
resValue "string", "GOOGLE_MAPS_ANDROID_API_KEY", googleMapsApiReleaseKey
}
Expand All @@ -41,7 +68,7 @@ android {
sourceSets {
main {
java {
srcDirs 'src/main/java', 'src/test'
srcDirs 'src/main/java', 'src/test', 'src/androidTest'
}
}
}
Expand All @@ -56,11 +83,12 @@ task androidAppVersion {

dependencies {
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
api 'androidx.appcompat:appcompat:1.3.0'
api 'androidx.appcompat:appcompat:1.6.1'
api 'androidx.activity:activity:1.8.0'
api 'com.google.android.material:material:1.6.0'
api 'androidx.preference:preference:1.2.1'
api 'androidx.lifecycle:lifecycle-extensions:2.2.0'
api 'mil.nga.geopackage.map:geopackage-android-map:6.7.1' // comment out to build locally
api 'mil.nga.geopackage.map:geopackage-android-map:6.7.2' // comment out to build locally
//api project(':geopackage-map') // uncomment me to build locally
api 'mil.nga.mgrs:mgrs-android:2.2.2'
api 'mil.nga.gars:gars-android:1.2.2'
Expand All @@ -71,31 +99,16 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
implementation 'org.locationtech.jts:jts-core:1.18.2'
implementation 'com.github.matomo-org:matomo-sdk-android:v2.0.0'
implementation 'junit:junit:4.12'
testImplementation 'androidx.multidex:multidex:2.0.1'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
implementation 'com.github.matomo-org:matomo-sdk-android:v2.0.0'
}

configure extensions.android, {
if (project.hasProperty('RELEASE_STORE_FILE') && new File((String) project.getProperty('RELEASE_STORE_FILE')).exists()) {
signingConfigs {
release {
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}
buildTypes {
release {
setSigningConfig(signingConfigs.release)
}
}
} else {
println 'no keystore configured'
}
testImplementation 'junit:junit:4.12'
testImplementation "org.robolectric:robolectric:4.7.3"
testImplementation 'androidx.test.espresso:espresso-core:3.5.1'
testImplementation 'androidx.test:core:1.5.0'
testImplementation 'androidx.test.ext:junit:1.1.5'
testImplementation 'androidx.test:runner:1.5.2'
testImplementation 'androidx.test:rules:1.5.0'
}

// This is to fix the errors : java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
Expand All @@ -110,4 +123,4 @@ configurations.all {
}
}

apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android'
4 changes: 4 additions & 0 deletions mapcache/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
package="mil.nga.mapcache"
android:installLocation="auto">

<uses-feature
android:name="android.hardware.camera"
android:required="false" />

<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.INTERNET" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,8 @@ private void processFeatureRow(MapFeaturesUpdateTask task, String database, Feat
}
}
} catch (Exception e) {
new Handler(Looper.getMainLooper()).post(() -> {
Toast toast = Toast.makeText(context, "Error loading geometry", Toast.LENGTH_SHORT);
toast.show();
});
// set task error
task.setErrorCount(task.getErrorCount() + 1);
}
}
}
Expand Down
Loading

0 comments on commit 2a4bc3c

Please sign in to comment.