最新消息:XAMPP默认安装之后是很不安全的,我们只需要点击左方菜单的 "安全"选项,按照向导操作即可完成安全设置。

Kotlin开发Android project gradle 和module gradle的配置

XAMPP案例 admin 673浏览 0评论

module gradle的配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
plugins {
id ‘com.android.application’
id ‘kotlin-android’
id ‘kotlin-android-extensions’
}

android {
compileSdkVersion 29
buildToolsVersion “30.0.2”

defaultConfig {
applicationId “com.rongyun.notificationdemo”
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName “1.0”

testInstrumentationRunner “androidx.test.runner.AndroidJUnitRunner”
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile(‘proguard-android-optimize.txt’), ‘proguard-rules.pro’
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = ‘1.8’
}
}

dependencies {

implementation “org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version”
implementation ‘androidx.core:core-ktx:1.3.2’
implementation ‘androidx.appcompat:appcompat:1.2.0’
implementation ‘com.google.android.material:material:1.2.1’
implementation ‘androidx.constraintlayout:constraintlayout:2.0.4’
testImplementation ‘junit:junit:4.+’
androidTestImplementation ‘androidx.test.ext:junit:1.1.2’
androidTestImplementation ‘androidx.test.espresso:espresso-core:3.3.0’

implementation “org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version”
}

Project的配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = “1.3.72”
repositories {
google()
maven{ url ‘http://maven.aliyun.com/nexus/content/groups/public/’ }
maven{ url ‘https://maven.aliyun.com/repository/google’ }

}
dependencies {
classpath “com.android.tools.build:gradle:4.1.1”
classpath “org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version”

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
maven{ url ‘http://maven.aliyun.com/nexus/content/groups/public/’ }
maven{ url ‘https://maven.aliyun.com/repository/google’ }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

转载请注明:XAMPP中文组官网 » Kotlin开发Android project gradle 和module gradle的配置

您必须 登录 才能发表评论!