2
0

Sign masterpassword-gui under Gradle.

This commit is contained in:
Maarten Billemont 2018-05-19 11:45:57 -04:00
parent 1bd61759bf
commit c43cc73ad5
6 changed files with 35 additions and 12 deletions

View File

@ -1,7 +1,15 @@
To build a release distribution:
STORE_PW=$(mpw masterpassword.keystore) KEY_PW=$(mpw masterpassword-android) gradle assembleRelease
Desktop:
STORE_PW=$(mpw masterpassword.keystore) KEY_PW=$(mpw masterpassword-desktop) gradle clean masterpassword-gui:shadowJar
Android:
STORE_PW=$(mpw masterpassword.keystore) KEY_PW=$(mpw masterpassword-android) gradle clean masterpassword-android:assembleRelease
Note:
- At the time of writing, Android does not build with JDK 9+. As such, the above command must be ran with JAVA_HOME pointing to JDK 7-8.
- The release keystores are not included in the repository. They are maintained by Maarten Billemont (lhunath@lyndir.com).

View File

@ -1,5 +1,5 @@
allprojects {
//apply plugin: 'findbugs'
apply plugin: 'findbugs'
group = 'com.lyndir.masterpassword'
version = 'GIT-SNAPSHOT'

View File

@ -18,19 +18,19 @@ android {
jackOptions.enabled true
}
// release with: STORE_PW=$(mpw masterpassword.keystore) KEY_PW=$(mpw masterpassword-android) gradle assembleRelease
// release with: STORE_PW=$(mpw masterpassword.keystore) KEY_PW_ANDROID=$(mpw masterpassword-android) gradle masterpassword-android:assembleRelease
signingConfigs {
release {
storeFile file( 'masterpassword.keystore' )
storePassword System.getenv( 'STORE_PW' )
keyAlias 'masterpassword-android'
keyPassword System.getenv( 'KEY_PW' )
keyPassword System.getenv( 'KEY_PW_ANDROID' )
}
}
buildTypes {
release {
if (System.getenv( 'STORE_PW' ) != null)
if (System.getenv( 'KEY_PW_ANDROID' ) != null)
signingConfig signingConfigs.release
}
}

View File

@ -82,9 +82,9 @@
<includes>
<include>target/*.apk</include>
</includes>
<keystore>release.jks</keystore>
<storepass>${env.PASSWORD}</storepass>
<keypass>${env.PASSWORD}</keypass>
<keystore>masterpassword.keystore</keystore>
<storepass>${env.STORE_PW}</storepass>
<keypass>${env.KEY_PW_ANDROID}</keypass>
<alias>masterpassword-android</alias>
<arguments>
<argument>-sigalg</argument>

View File

@ -1,7 +1,7 @@
plugins {
id 'java'
id 'application'
id 'com.github.johnrengelman.shadow' version '1.2.4'
id 'com.github.johnrengelman.shadow' version '2.0.4'
}
description = 'Master Password GUI'
@ -14,6 +14,21 @@ dependencies {
compile group: 'com.yuvimasory', name: 'orange-extensions', version: '1.3.0'
}
// release with: STORE_PW=$(mpw masterpassword.keystore) KEY_PW_ANDROID=$(mpw masterpassword-android) gradle masterpassword-gui:shadowJar
shadowJar.doLast {
if (System.getenv( 'KEY_PW_DESKTOP' ) != null)
ant.signjar(
jar: archivePath,
alias: 'masterpassword-desktop',
keystore: 'masterpassword.keystore',
storepass: System.getenv( 'STORE_PW' ),
keypass: System.getenv( 'KEY_PW_DESKTOP' ),
preservelastmodified: 'true',
destdir: '.'
)
}
run {
// I don't fully understand why this is necessary, but without it -Dmp.log.level is lost.
systemProperties = System.properties

View File

@ -112,9 +112,9 @@
<includes>
<include>target/*.jar</include>
</includes>
<keystore>release.jks</keystore>
<storepass>${env.PASSWORD}</storepass>
<keypass>${env.PASSWORD}</keypass>
<keystore>masterpassword.keystore</keystore>
<storepass>${env.STORE_PW}</storepass>
<keypass>${env.KEY_PW_DESKTOP}</keypass>
<alias>masterpassword-desktop</alias>
<arguments>
<argument>-sigalg</argument>