Skip to content

Commit

Permalink
🎨 Add sign config
Browse files Browse the repository at this point in the history
  • Loading branch information
Flyge committed Nov 2, 2017
1 parent 4afdf8a commit b56c038
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions sample-video-thumbnail/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

Properties localProperties = openProperties("local.properties")
String jksFileName = localProperties.getProperty("sample.storeFile")
File jksFile = jksFileName != null && "" != jksFileName.trim() ? file(jksFileName) : null

android {
compileSdkVersion COMPILE_SDK_VERSION.toInteger()
buildToolsVersion "${BUILD_TOOLS_VERSION}"
Expand All @@ -17,10 +21,20 @@ android {
}
}

signingConfigs {
release {
storeFile jksFile
storePassword localProperties.getProperty('sample.storePassword')
keyAlias localProperties.getProperty('sample.keyAlias')
keyPassword localProperties.getProperty('sample.keyPassword')
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
}
Expand All @@ -39,3 +53,15 @@ dependencies {

implementation "com.github.wseemann:FFmpegMediaMetadataRetriever:${FFMPEG_MEDIA_METADATA_RETRIEVER_VERSION}"
}

Properties openProperties(String fileName) {
File propertiesFile = new File(projectDir, fileName)
if (!propertiesFile.exists()) {
return new Properties()
}
FileInputStream inputStream = new FileInputStream(propertiesFile)
Properties properties = new Properties()
properties.load(inputStream)
inputStream.close()
return properties
}
Binary file added sample-video-thumbnail/release.jks
Binary file not shown.

0 comments on commit b56c038

Please sign in to comment.