Skip to content

Commit 086fcc9

Browse files
Merge pull request nextcloud#14561 from nextcloud/PrepareBuildKts
Prepare for build with *.kts files
2 parents e62ff36 + f8d175a commit 086fcc9

7 files changed

Lines changed: 167 additions & 173 deletions

File tree

app/build.gradle

Lines changed: 92 additions & 92 deletions
Large diffs are not rendered by default.

appscan/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

appscan/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ buildscript {
1414
}
1515
}
1616

17-
apply plugin: 'com.android.library'
18-
apply plugin: 'kotlin-android'
17+
apply plugin: "com.android.library"
18+
apply plugin: "kotlin-android"
1919

2020
android {
21-
namespace 'com.nextcloud.appscan'
21+
namespace "com.nextcloud.appscan"
2222

2323
defaultConfig {
2424
minSdk 25
@@ -40,7 +40,7 @@ android {
4040
}
4141

4242
kotlinOptions {
43-
jvmTarget = '17'
43+
jvmTarget = "17"
4444
}
4545
}
4646

build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ buildscript {
1212
ext {
1313
androidLibraryVersion ="be43184f87164bd5ec4f1d2ed912665203433321"
1414
androidCommonLibraryVersion = "0.25.0"
15-
androidPluginVersion = '8.9.0'
16-
androidxMediaVersion = '1.5.1'
15+
androidPluginVersion = "8.9.0"
16+
androidxMediaVersion = "1.5.1"
1717
androidxTestVersion = "1.6.1"
18-
appCompatVersion = '1.7.0'
18+
appCompatVersion = "1.7.0"
1919
checkerVersion = "3.21.2"
2020
daggerVersion = "2.55"
2121
documentScannerVersion = "1.1.1"
2222
espressoVersion = "3.6.1"
23-
jacoco_version = '0.8.12'
24-
kotlin_version = '2.1.10'
23+
jacoco_version = "0.8.12"
24+
kotlin_version = "2.1.10"
2525
markwonVersion = "4.6.2"
2626
mockitoVersion = "4.11.0"
2727
mockitoKotlinVersion = "4.1.0"
@@ -50,18 +50,18 @@ subprojects {
5050
}
5151
}
5252

53-
tasks.register('clean', Delete) {
53+
tasks.register("clean", Delete) {
5454
delete rootProject.buildDir
5555
}
5656

57-
tasks.register('installGitHooks', Copy) {
57+
tasks.register("installGitHooks", Copy) {
5858
def sourceFolder = "${rootProject.projectDir}/scripts/hooks"
5959
def destFolder = "${rootProject.projectDir}/.git/hooks"
6060

6161
description = "Install git hooks"
6262

6363
from(sourceFolder) {
64-
include '*'
64+
include "*"
6565
}
6666
into destFolder
6767

jacoco.gradle

Lines changed: 55 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apply plugin: 'jacoco'
1+
apply plugin: "jacoco"
22

33
jacoco {
44
toolVersion = "$jacoco_version"
@@ -10,7 +10,7 @@ subprojects {
1010
configurations.all {
1111
resolutionStrategy {
1212
eachDependency { details ->
13-
if ('org.jacoco' == details.requested.group) {
13+
if ("org.jacoco" == details.requested.group) {
1414
details.useVersion "$jacocoVersion"
1515
}
1616
}
@@ -20,9 +20,9 @@ subprojects {
2020

2121
project.afterEvaluate { project ->
2222

23-
tasks.withType(Test) {
23+
tasks.withType(Test).configureEach {
2424
jacoco.includeNoLocationClasses = true
25-
jacoco.excludes = ['jdk.internal.*']
25+
jacoco.excludes = ["jdk.internal.*"]
2626
}
2727

2828
final flavor = "Gplay"
@@ -39,57 +39,56 @@ project.afterEvaluate { project ->
3939
}
4040

4141
final fileFilter = [
42-
// data binding
43-
'**/databinding/*',
44-
'android/databinding/**/*.class',
45-
'**/android/databinding/*Binding.class',
46-
'**/android/databinding/*',
47-
'**/androidx/databinding/*',
48-
'**/BR.*',
49-
// android
50-
'**/R.class',
51-
'**/R$*.class',
52-
'**/BuildConfig.*',
53-
'**/Manifest*.*',
54-
'**/*Test*.*',
55-
'android/**/*.*',
56-
// kotlin
57-
'**/*MapperImpl*.*',
58-
'**/*$ViewInjector*.*',
59-
'**/*$ViewBinder*.*',
60-
'**/BuildConfig.*',
61-
'**/*Component*.*',
62-
'**/*BR*.*',
63-
'**/Manifest*.*',
64-
'**/*$Lambda$*.*',
65-
'**/*Companion*.*',
66-
'**/*Module*.*',
67-
'**/*Dagger*.*',
68-
'**/*Hilt*.*',
69-
'**/*MembersInjector*.*',
70-
'**/*_MembersInjector.class',
71-
'**/*_Factory*.*',
72-
'**/*_Provide*Factory*.*',
73-
'**/*Extensions*.*',
74-
// sealed and data classes
75-
'**/*$Result.*',
76-
'**/*$Result$*.*',
77-
// adapters generated by moshi
78-
'**/*JsonAdapter.*',
79-
// Hilt
80-
'**/*Module.kt',
81-
'**/di/**',
82-
'dagger.hilt.internal/*',
83-
'hilt_aggregated_deps/*',
42+
// data binding
43+
"**/databinding/*",
44+
"android/databinding/**/*.class",
45+
"**/android/databinding/*Binding.class",
46+
"**/android/databinding/*",
47+
"**/androidx/databinding/*",
48+
"**/BR.*",
49+
// android
50+
"**/R.class",
51+
"**/R\$*.class",
52+
"**/BuildConfig.*",
53+
"**/Manifest*.*",
54+
"**/*Test*.*",
55+
"android/**/*.*",
56+
// kotlin
57+
"**/*MapperImpl*.*",
58+
"**/*\$ViewInjector*.*",
59+
"**/*\$ViewBinder*.*",
60+
"**/BuildConfig.*",
61+
"**/*Component*.*",
62+
"**/*BR*.*",
63+
"**/Manifest*.*",
64+
"**/*\$Lambda\$*.*",
65+
"**/*Companion*.*",
66+
"**/*Module*.*",
67+
"**/*Dagger*.*",
68+
"**/*Hilt*.*",
69+
"**/*MembersInjector*.*",
70+
"**/*_MembersInjector.class",
71+
"**/*_Factory*.*",
72+
"**/*_Provide*Factory*.*",
73+
"**/*Extensions*.*",
74+
// sealed and data classes
75+
"**/*\$Result.*",
76+
"**/*\$Result\$*.*",
77+
// adapters generated by moshi
78+
"**/*JsonAdapter.*",
79+
// Hilt
80+
"**/*Module.kt",
81+
"**/di/**",
82+
"dagger.hilt.internal/*",
83+
"hilt_aggregated_deps/*",
8484

85-
'**/*$Result.*', /* filtering `sealed` and `data` classes */
86-
'**/*$Result$*.*',/* filtering `sealed` and `data` classes */
87-
'**/*Args*.*', /* filtering Navigation Component generated classes */
88-
'**/*Directions*.*', /* filtering Navigation Component generated classes */
89-
'**/*inlined*.class', /* filtering inlined classes */
90-
'**/composables/**'
91-
/* INSERT ANY OTHER JUNK YOU WANT FILTERED OUT HERE */
92-
]
85+
"**/*\$Result.*", /* filtering `sealed` and `data` classes */
86+
"**/*\$Result\$*.*",/* filtering `sealed` and `data` classes */
87+
"**/*Args*.*", /* filtering Navigation Component generated classes */
88+
"**/*Directions*.*", /* filtering Navigation Component generated classes */
89+
"**/*inlined*.class", /* filtering inlined classes */
90+
"**/composables/**"
91+
/* INSERT ANY OTHER JUNK YOU WANT FILTERED OUT HERE */]
9392

9493
final androidKotlinTree = fileTree(dir: "${project.buildDir}/tmp/kotlin-classes/${variant}", excludes: fileFilter)
9594
final kotlinTree = fileTree(dir: "${project.buildDir}/classes/kotlin/main", excludes: fileFilter)
@@ -101,9 +100,7 @@ project.afterEvaluate { project ->
101100

102101
sourceDirectories.setFrom files([mainSrc, productFlavorSrc, buildTypeSrc])
103102
classDirectories.setFrom files([androidKotlinTree, kotlinTree, javacTree])
104-
executionData.setFrom fileTree(dir: project.buildDir, includes: [
105-
"jacoco/test${variant.capitalize()}UnitTest.exec",
106-
"outputs/unit_test_code_coverage/${variant}UnitTest/test${variant.capitalize()}UnitTest.exec",
107-
])
103+
executionData.setFrom fileTree(dir: project.buildDir, includes: ["jacoco/test${variant.capitalize()}UnitTest.exec",
104+
"outputs/unit_test_code_coverage/${variant}UnitTest/test${variant.capitalize()}UnitTest.exec",])
108105
}
109106
}

scripts/analysis/detectWrongSettings.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ snapshotCount=$(./gradlew dependencies | grep SNAPSHOT -c)
88
betaCount=$(grep "<bool name=\"is_beta\">true</bool>" app/src/main/res/values/setup.xml -c)
99
libraryHash=$(grep androidLibraryVersion build.gradle | cut -d= -f2 | tr -d \")
1010

11+
lastHashes=$(curl "https://api.github.com/repos/nextcloud/android-library/commits?sha=$baseBranch" | jq ".[] .sha" | head -n 20)
1112
baseBranch="master"
12-
lastHashes=$(curl "https://api.github.com/repos/nextcloud/android-library/commits?sha=$baseBranch" | jq ".[] .sha" | head -n 10)
1313

1414
if [[ $(echo "$lastHashes" | grep -c $libraryHash) -ne 1 ]]; then
1515
echo "Library commit not within last 10 hashes, please rebase!"

settings.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
* SPDX-FileCopyrightText: 2014-2024 Nextcloud GmbH and Nextcloud contributors
55
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
66
*/
7-
rootProject.name = 'Nextcloud'
7+
rootProject.name = "Nextcloud"
88

9-
include ':app'
10-
include ':appscan'
9+
include ":app"
10+
include ":appscan"
1111

12-
//includeBuild('../android-common') {
12+
//includeBuild("../android-common") {
1313
// dependencySubstitution {
14-
// substitute module('com.github.nextcloud.android-common:ui') using project(':ui')
14+
// substitute module("com.github.nextcloud.android-common:ui") using project(":ui")
1515
// }
1616
//}
1717

18-
//includeBuild('../android-library') {
18+
//includeBuild("../android-library") {
1919
// dependencySubstitution {
20-
// substitute module('com.github.nextcloud:android-library') using project(':library')
20+
// substitute module("com.github.nextcloud:android-library") using project(":library")
2121
// }
2222
//}

0 commit comments

Comments
 (0)