From 04088b34a2282c0b6a24fac83fd86ec06fc75511 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 4 Jan 2019 17:55:17 +0800 Subject: [PATCH] Update gradle scripts --- app/build.gradle | 29 +++++++++-------------------- build.gradle | 32 +++++++++++++++++++++++--------- core/build.gradle | 15 --------------- native/build.gradle | 2 -- net/build.gradle | 15 --------------- snet/build.gradle | 4 ---- 6 files changed, 32 insertions(+), 65 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index a7350f429..d7350c5d1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,13 +5,8 @@ def configPath = project.hasProperty('configPath') ? project.configPath : rootPr configProps.load(new FileInputStream(configPath)) android { - compileSdkVersion rootProject.ext.compileSdkVersion - buildToolsVersion rootProject.ext.buildToolsVersion - defaultConfig { - minSdkVersion 17 applicationId "com.topjohnwu.magisk" - targetSdkVersion rootProject.ext.compileSdkVersion 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 { disable 'MissingTranslation' } @@ -71,19 +58,21 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'androidx.core:core:1.0.1' implementation project(':net') 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.preference:preference:${rootProject.ext.androidXVersion}" - fullImplementation "androidx.recyclerview:recyclerview:${rootProject.ext.androidXVersion}" - fullImplementation "androidx.cardview:cardview:${rootProject.ext.androidXVersion}" - fullImplementation "com.google.android.material:material:${rootProject.ext.androidXVersion}" + fullImplementation "androidx.preference:preference:${androidXVersion}" + fullImplementation "androidx.recyclerview:recyclerview:${androidXVersion}" + fullImplementation "androidx.cardview:cardview:${androidXVersion}" + fullImplementation "com.google.android.material:material:${androidXVersion}" fullImplementation 'android.arch.work:work-runtime:1.0.0-beta01' fullImplementation 'androidx.lifecycle:lifecycle-extensions: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' if (properties.containsKey('android.injected.invoked.from.ide')) { diff --git a/build.gradle b/build.gradle index cf1700675..6940a1964 100644 --- a/build.gradle +++ b/build.gradle @@ -15,20 +15,34 @@ buildscript { } } -allprojects { +task clean(type: Delete) { + delete rootProject.buildDir +} + +subprojects { repositories { google() jcenter() maven { url "https://jitpack.io" } } -} + afterEvaluate { + if (getPlugins().hasPlugin('com.android.library') || + getPlugins().hasPlugin('com.android.application')) { + android { + compileSdkVersion 28 + buildToolsVersion "28.0.3" -ext { - compileSdkVersion = 28 - buildToolsVersion = "28.0.3" - androidXVersion = "1.0.0" -} + defaultConfig { + if (minSdkVersion == null) + minSdkVersion 17 + targetSdkVersion 28 + } -task clean(type: Delete) { - delete rootProject.buildDir + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + } + } + } } diff --git a/core/build.gradle b/core/build.gradle index 43a1c182c..e640219b4 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,21 +1,6 @@ apply plugin: 'com.android.library' 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 { release { minifyEnabled false diff --git a/native/build.gradle b/native/build.gradle index 1bc8cafa4..146637410 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -1,8 +1,6 @@ apply plugin: 'com.android.library' android { - compileSdkVersion rootProject.ext.compileSdkVersion - buildToolsVersion rootProject.ext.buildToolsVersion externalNativeBuild { ndkBuild { diff --git a/net/build.gradle b/net/build.gradle index f754ca5be..b16ee12fb 100644 --- a/net/build.gradle +++ b/net/build.gradle @@ -1,21 +1,6 @@ apply plugin: 'com.android.library' 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 { release { minifyEnabled false diff --git a/snet/build.gradle b/snet/build.gradle index 5ed9c6d22..575e504ad 100644 --- a/snet/build.gradle +++ b/snet/build.gradle @@ -1,13 +1,9 @@ apply plugin: 'com.android.application' android { - compileSdkVersion rootProject.ext.compileSdkVersion - buildToolsVersion rootProject.ext.buildToolsVersion - defaultConfig { applicationId "com.topjohnwu.snet" minSdkVersion 14 - targetSdkVersion rootProject.ext.compileSdkVersion versionCode 12 versionName "snet" }