Skip to content

Commit

Permalink
规范Gradle插件
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowsocksRb committed Aug 2, 2021
1 parent f48a081 commit 919a72c
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 41 deletions.
41 changes: 10 additions & 31 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,37 +1,16 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
javaVersion = JavaVersion.VERSION_1_8
kotlinVersion = '1.5.21'
ndkVersion = '21.4.7075529'
minSdkVersion = 21
sdkVersion = 31
compileSdkVersion = 31
buildToolsVersion = '31.0.0'
desugarLibsVersion = '1.1.5'
versionCode = 410
versionName = '5.0.6R.2'
resConfigs = ['zh-rCN']
}

repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
ext {
javaVersion = JavaVersion.VERSION_1_8
ndkVersion = '21.4.7075529'
minSdkVersion = 21
sdkVersion = 31
compileSdkVersion = 31
buildToolsVersion = '31.0.0'
versionCode = 410
versionName = '5.0.6R.2'
resConfigs = ['zh-rCN']
}

allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
configurations.all {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7'
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
Expand Down
6 changes: 3 additions & 3 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'kotlin-parcelize'
id 'kotlin-kapt'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.kotlin.plugin.parcelize'
id 'org.jetbrains.kotlin.kapt'
}

android {
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
kapt.incremental.apt=true

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 3 additions & 3 deletions mobile/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-parcelize'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.kotlin.plugin.parcelize'
}

android {
Expand Down Expand Up @@ -65,7 +65,7 @@ android {
}

dependencies {
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:$desugarLibsVersion"
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
implementation project(':core')
implementation 'androidx.browser:browser:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
Expand Down
4 changes: 2 additions & 2 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'kotlin-parcelize'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.kotlin.plugin.parcelize'
}

android {
Expand Down
24 changes: 24 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
plugins {
def agp = '7.0.0'
def kotlin = '1.5.21'
id 'com.android.application' version agp
id 'com.android.library' version agp
id 'org.jetbrains.kotlin.android' version kotlin
id 'org.jetbrains.kotlin.plugin.parcelize' version kotlin
id 'org.jetbrains.kotlin.kapt' version kotlin
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter()
}
}
include ':mobile', ':core', ':plugin'

0 comments on commit 919a72c

Please sign in to comment.