Update gradle scripts

This commit is contained in:
topjohnwu 2019-01-04 17:55:17 +08:00
parent 3edcd2004e
commit 04088b34a2
6 changed files with 32 additions and 65 deletions

View File

@ -5,13 +5,8 @@ def configPath = project.hasProperty('configPath') ? project.configPath : rootPr
configProps.load(new FileInputStream(configPath)) configProps.load(new FileInputStream(configPath))
android { android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig { defaultConfig {
minSdkVersion 17
applicationId "com.topjohnwu.magisk" applicationId "com.topjohnwu.magisk"
targetSdkVersion rootProject.ext.compileSdkVersion
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
} }
@ -56,14 +51,6 @@ android {
} }
} }
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
preDexLibraries true
javaMaxHeapSize "2g"
}
lintOptions { lintOptions {
disable 'MissingTranslation' disable 'MissingTranslation'
} }
@ -71,19 +58,21 @@ android {
dependencies { dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.core:core:1.0.1'
implementation project(':net') implementation project(':net')
fullImplementation project(':core') fullImplementation project(':core')
fullImplementation 'ru.noties:markwon:2.0.1'
fullImplementation 'com.caverock:androidsvg-aar:1.3'
def androidXVersion = "1.0.0"
implementation 'androidx.core:core:1.0.1'
fullImplementation 'androidx.appcompat:appcompat:1.0.2' fullImplementation 'androidx.appcompat:appcompat:1.0.2'
fullImplementation "androidx.preference:preference:${rootProject.ext.androidXVersion}" fullImplementation "androidx.preference:preference:${androidXVersion}"
fullImplementation "androidx.recyclerview:recyclerview:${rootProject.ext.androidXVersion}" fullImplementation "androidx.recyclerview:recyclerview:${androidXVersion}"
fullImplementation "androidx.cardview:cardview:${rootProject.ext.androidXVersion}" fullImplementation "androidx.cardview:cardview:${androidXVersion}"
fullImplementation "com.google.android.material:material:${rootProject.ext.androidXVersion}" fullImplementation "com.google.android.material:material:${androidXVersion}"
fullImplementation 'android.arch.work:work-runtime:1.0.0-beta01' fullImplementation 'android.arch.work:work-runtime:1.0.0-beta01'
fullImplementation 'androidx.lifecycle:lifecycle-extensions:2.0.0' fullImplementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
fullImplementation 'androidx.room:room-runtime:2.0.0' fullImplementation 'androidx.room:room-runtime:2.0.0'
fullImplementation 'ru.noties:markwon:2.0.1'
fullImplementation 'com.caverock:androidsvg-aar:1.3'
def butterKnifeVersion = '10.0.0' def butterKnifeVersion = '10.0.0'
if (properties.containsKey('android.injected.invoked.from.ide')) { if (properties.containsKey('android.injected.invoked.from.ide')) {

View File

@ -15,20 +15,34 @@ buildscript {
} }
} }
allprojects { task clean(type: Delete) {
delete rootProject.buildDir
}
subprojects {
repositories { repositories {
google() google()
jcenter() jcenter()
maven { url "https://jitpack.io" } maven { url "https://jitpack.io" }
} }
afterEvaluate {
if (getPlugins().hasPlugin('com.android.library') ||
getPlugins().hasPlugin('com.android.application')) {
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
if (minSdkVersion == null)
minSdkVersion 17
targetSdkVersion 28
} }
ext { compileOptions {
compileSdkVersion = 28 sourceCompatibility JavaVersion.VERSION_1_8
buildToolsVersion = "28.0.3" targetCompatibility JavaVersion.VERSION_1_8
androidXVersion = "1.0.0" }
}
}
} }
task clean(type: Delete) {
delete rootProject.buildDir
} }

View File

@ -1,21 +1,6 @@
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
android { android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion 17
targetSdkVersion rootProject.ext.compileSdkVersion
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes { buildTypes {
release { release {
minifyEnabled false minifyEnabled false

View File

@ -1,8 +1,6 @@
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
android { android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
externalNativeBuild { externalNativeBuild {
ndkBuild { ndkBuild {

View File

@ -1,21 +1,6 @@
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
android { android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion 16
targetSdkVersion rootProject.ext.compileSdkVersion
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes { buildTypes {
release { release {
minifyEnabled false minifyEnabled false

View File

@ -1,13 +1,9 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
android { android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig { defaultConfig {
applicationId "com.topjohnwu.snet" applicationId "com.topjohnwu.snet"
minSdkVersion 14 minSdkVersion 14
targetSdkVersion rootProject.ext.compileSdkVersion
versionCode 12 versionCode 12
versionName "snet" versionName "snet"
} }