This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* release: move scripts to scripts directory Signed-off-by: Harsh Shandilya <[email protected]> * Move CI secrets to secrets directory Signed-off-by: Harsh Shandilya <[email protected]> * gradle: uprev to 6.7 Signed-off-by: Harsh Shandilya <[email protected]> * gradle: suppress warnings about unsupported options Signed-off-by: Harsh Shandilya <[email protected]> * build: update dependencies Signed-off-by: Harsh Shandilya <[email protected]> * build: move Gradle plugins to ext Signed-off-by: Harsh Shandilya <[email protected]> * build: move configuration tasks to buildSrc Signed-off-by: Harsh Shandilya <[email protected]> * CHANGELOG: add entry for #1137 Signed-off-by: Harsh Shandilya <[email protected]> * Fix lint warnings Signed-off-by: Harsh Shandilya <[email protected]>
- Loading branch information
Showing
24 changed files
with
222 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,30 @@ | ||
apply(from = "buildDependencies.gradle") | ||
val build: Map<Any, Any> by extra | ||
|
||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
jcenter() | ||
google() | ||
gradlePluginPortal() | ||
} | ||
|
||
kotlinDslPluginOptions { | ||
experimentalWarning.set(false) | ||
} | ||
|
||
gradlePlugin { | ||
plugins { | ||
register("aps") { | ||
id = "aps-plugin" | ||
implementationClass = "PasswordStorePlugin" | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(build.getValue("kotlinGradlePlugin")) | ||
implementation(build.getValue("androidGradlePlugin")) | ||
implementation(build.getValue("binaryCompatibilityValidator")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
rootProject.ext.versions = [ | ||
agp : '4.1.0', | ||
kotlin : '1.4.10', | ||
binary_compatibility_validator : '0.2.3', | ||
] | ||
|
||
rootProject.ext.build = [ | ||
androidGradlePlugin : "com.android.tools.build:gradle:${versions.agp}", | ||
kotlinGradlePlugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}", | ||
binaryCompatibilityValidator : "org.jetbrains.kotlinx:binary-compatibility-validator:${versions.binary_compatibility_validator}", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved. | ||
* SPDX-License-Identifier: GPL-3.0-only | ||
*/ | ||
|
||
import com.android.build.gradle.TestedExtension | ||
import org.gradle.api.JavaVersion | ||
import org.gradle.api.Project | ||
import org.gradle.api.tasks.Delete | ||
import org.gradle.api.tasks.testing.Test | ||
import org.gradle.api.tasks.testing.logging.TestLogEvent | ||
import org.gradle.api.tasks.wrapper.Wrapper | ||
import org.gradle.kotlin.dsl.repositories | ||
import org.gradle.kotlin.dsl.withType | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
/** | ||
* Configure root project. | ||
* Note that classpath dependencies still need to be defined in the `buildscript` block in the top-level build.gradle.kts file. | ||
*/ | ||
internal fun Project.configureForRootProject() { | ||
// register task for cleaning the build directory in the root project | ||
tasks.register("clean", Delete::class.java) { | ||
delete(rootProject.buildDir) | ||
} | ||
tasks.withType<Wrapper> { | ||
gradleVersion = "6.7" | ||
distributionType = Wrapper.DistributionType.ALL | ||
distributionSha256Sum = "0080de8491f0918e4f529a6db6820fa0b9e818ee2386117f4394f95feb1d5583" | ||
} | ||
configureBinaryCompatibilityValidator() | ||
} | ||
|
||
/** | ||
* Configure all projects including the root project | ||
*/ | ||
internal fun Project.configureForAllProjects() { | ||
repositories { | ||
google() | ||
jcenter() | ||
maven { setUrl("https://jitpack.io") } | ||
} | ||
tasks.withType<KotlinCompile> { | ||
kotlinOptions { | ||
jvmTarget = JavaVersion.VERSION_1_8.toString() | ||
freeCompilerArgs = freeCompilerArgs + additionalCompilerArgs | ||
languageVersion = "1.4" | ||
} | ||
} | ||
tasks.withType<Test> { | ||
maxParallelForks = Runtime.getRuntime().availableProcessors() * 2 | ||
testLogging { | ||
events(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED) | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Apply baseline configurations for all Android projects (Application and Library). | ||
*/ | ||
@Suppress("UnstableApiUsage") | ||
internal fun TestedExtension.configureCommonAndroidOptions() { | ||
compileSdkVersion(29) | ||
|
||
defaultConfig { | ||
minSdkVersion(23) | ||
targetSdkVersion(29) | ||
} | ||
|
||
packagingOptions { | ||
exclude("**/*.version") | ||
exclude("**/*.txt") | ||
exclude("**/*.kotlin_module") | ||
exclude("**/plugin.properties") | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
testOptions.animationsDisabled = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved. | ||
* SPDX-License-Identifier: GPL-3.0-only | ||
*/ | ||
|
||
import kotlinx.validation.ApiValidationExtension | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
|
||
internal fun Project.configureBinaryCompatibilityValidator() { | ||
extensions.configure<ApiValidationExtension> { | ||
ignoredProjects = mutableSetOf( | ||
"app" | ||
) | ||
} | ||
} |
Oops, something went wrong.