Skip to content

Commit ae6ce5f

Browse files
committedNov 8, 2019
Convert build scripts to groovy.
Change-Id: Ib192840f186d792bfcd516e3a50168f698d21234
1 parent 6ec585e commit ae6ce5f

File tree

5 files changed

+91
-94
lines changed

5 files changed

+91
-94
lines changed
 

Diff for: ‎JetNews/app/build.gradle

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/*
2+
* Copyright 2019 Google, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
apply plugin: 'com.android.application'
18+
apply plugin: 'kotlin-android'
19+
20+
android {
21+
compileSdkVersion 29
22+
defaultConfig {
23+
applicationId "com.example.jetnews"
24+
minSdkVersion 21
25+
targetSdkVersion 29
26+
versionCode 1
27+
versionName "1.0"
28+
vectorDrawables.useSupportLibrary = true
29+
}
30+
buildTypes {
31+
release {
32+
minifyEnabled false
33+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
34+
}
35+
}
36+
37+
compileOptions {
38+
sourceCompatibility JavaVersion.VERSION_1_8
39+
targetCompatibility JavaVersion.VERSION_1_8
40+
}
41+
42+
kotlinOptions {
43+
jvmTarget = "1.8"
44+
}
45+
46+
buildFeatures {
47+
compose true
48+
}
49+
}
50+
51+
configurations {
52+
ktlint
53+
}
54+
55+
dependencies {
56+
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version")
57+
implementation("androidx.compose:compose-runtime:$compose_version")
58+
implementation("androidx.ui:ui-framework:$compose_version")
59+
implementation("androidx.ui:ui-layout:$compose_version")
60+
implementation("androidx.ui:ui-material:$compose_version")
61+
implementation "androidx.ui:ui-tooling:$compose_version"
62+
implementation('androidx.appcompat:appcompat:1.1.0')
63+
implementation('androidx.activity:activity-ktx:1.0.0')
64+
implementation "androidx.core:core-ktx:1.1.0"
65+
ktlint "com.pinterest:ktlint:0.35.0"
66+
}
67+
68+
task ktlint(type: JavaExec, group: "verification") {
69+
description = "Check Kotlin code style."
70+
main = "com.pinterest.ktlint.Main"
71+
classpath = configurations.ktlint
72+
args "src/**/*.kt"
73+
}
74+
75+
check.dependsOn ktlint
76+
77+
task ktlintFormat(type: JavaExec, group: "formatting") {
78+
description = "Fix Kotlin code style deviations."
79+
main = "com.pinterest.ktlint.Main"
80+
classpath = configurations.ktlint
81+
args "-F", "src/**/*.kt"
82+
}

Diff for: ‎JetNews/app/build.gradle.kts

-83
This file was deleted.

Diff for: ‎JetNews/build.gradle.kts renamed to ‎JetNews/build.gradle

+7-9
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,23 @@
1515
*/
1616

1717
buildscript {
18+
ext.kotlin_version = '1.3.60-eap-76'
19+
ext.compose_version = '0.1.0-dev02'
1820
repositories {
1921
google()
2022
jcenter()
21-
maven {
22-
url = uri("https://dl.bintray.com/kotlin/kotlin-eap")
23-
}
23+
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
2424
}
2525
dependencies {
26-
classpath("com.android.tools.build:gradle:4.0.0-alpha02")
27-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.60-eap-76")
26+
classpath 'com.android.tools.build:gradle:4.0.0-alpha02'
27+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
2828
}
2929
}
30-
30+
3131
allprojects {
3232
repositories {
3333
google()
3434
jcenter()
35-
maven {
36-
url = uri("https://dl.bintray.com/kotlin/kotlin-eap")
37-
}
35+
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
3836
}
3937
}

Diff for: ‎JetNews/settings.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include ':app'
2+
rootProject.name='JetNews'

Diff for: ‎JetNews/settings.gradle.kts

-2
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.