Skip to content

Instantly share code, notes, and snippets.

View smhdk's full-sized avatar

Semih Dik smhdk

  • İstanbul
View GitHub Profile
@smhdk
smhdk / Android Plugin Version in build.gradle
Created March 18, 2018 17:50
Android Plugin Version in build.gradle
buildscript {
repositories {
// Gradle 4.1 and higher include support for Google's Maven repo using
// the google() method. And you need to include this repo to download
// Android plugin 3.0.0 or higher.
google()
...
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
@smhdk
smhdk / Gradle version in gradle-wrapper.properties
Created March 18, 2018 18:02
Gradle version in gradle-wrapper.properties
distributionUrl = https\://services.gradle.org/distributions/gradle-4.1-all.zip
...
@smhdk
smhdk / Module build.gradle Build Type example
Created March 19, 2018 09:55
Module build.gradle Build Type example
android {
defaultConfig {
manifestPlaceholders = [hostName:"www.example.com"]
...
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
@smhdk
smhdk / Modul build.gradle Product Flavors example
Created March 19, 2018 10:04
Modul build.gradle Product Flavors example
android {
...
defaultConfig {...}
buildTypes {...}
productFlavors {
demo {
applicationIdSuffix ".demo"
versionNameSuffix "-demo"
}
full {
@smhdk
smhdk / Modul build.gradle dependencies example
Created March 19, 2018 10:20
Modul build.gradle dependencies example
apply plugin: 'com.android.application'
android { ... }
dependencies {
// Dependency on a local library module
compile project(":mylibrary")
// Dependency on local binaries
compile fileTree(dir: 'libs', include: ['*.jar'])
@smhdk
smhdk / Project build.gradle example
Created March 19, 2018 10:22
Project build.gradle example
allprojects {
repositories {
jcenter()
}
}
@smhdk
smhdk / gist:56b962eb4c13015fb7aa86e984b27125
Created March 19, 2018 10:29
Modul build.gradle signingConfigs Example
android {
...
defaultConfig { ... }
signingConfigs {
release {
storeFile file("my-release-key.jks")
storePassword "password"
keyAlias "my-alias"
keyPassword "password"
}
android {
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
...
}
@smhdk
smhdk / Modul build.gradle Proguard example 2
Created March 19, 2018 10:44
Modul build.gradle Proguard example 2
android {
...
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
release {
minifyEnabled true
shrinkResources true
signingConfig signingConfigs.releaseConfig
proguardFiles getDefaultProguardFile('proguard-android.txt')
proguardFiles fileTree(dir: 'proguard', include: ['*.pro']).asList().toArray()
}