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
pluginManagement { | |
repositories { | |
// The repo where to look for | |
maven {url = uri("https://com.example/m2")} | |
} | |
} |
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
pluginManagement { | |
resolutionStrategy { | |
// These plugins don't have a marker artifact, tell gradle were to look them up | |
eachPlugin { | |
if (requested.id.id == "com.android.application") { | |
useModule("com.android.tools.build:gradle:${requested.version}") | |
} | |
if (requested.id.id == "com.squareup.sqldelight") { | |
useModule("com.squareup.sqldelight:gradle-plugin:${requested.version}") | |
} |
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
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.jetbrains.kotlin.jvm</groupId> | |
<artifactId>org.jetbrains.kotlin.jvm.gradle.plugin</artifactId> | |
<version>1.3.60</version> | |
<packaging>pom</packaging> | |
<dependencies> | |
<dependency> | |
<groupId>org.jetbrains.kotlin</groupId> | |
<artifactId>kotlin-gradle-plugin</artifactId> |
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
// settings.gradle.kts | |
pluginManagement { | |
repositories { | |
mavenCentral() | |
google() | |
} | |
plugins { | |
id("com.android.application").version("3.5.2") | |
id("com.squareup.sqldelight").version("1.2.0") |
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
// buildSrc/build.gradle.kts | |
repositories { | |
mavenCentral() | |
google() | |
} | |
dependencies { | |
// add all your plugins artifacts here | |
classpath("com.android.tools.build:gradle:3.5.2") |
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
package com.example | |
class GreetingPlugin : Plugin<Project> { | |
override fun apply(project: Project) { | |
project.task("hello") { | |
doLast { | |
println("Hello from the GreetingPlugin") | |
} | |
} | |
} |
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
// build.gradle | |
buildscript { | |
repositories { | |
google() | |
} | |
dependencies { | |
// add the plugin to the build classpath | |
classpath("com.android.tools.build:gradle:3.5.2") | |
} |
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
tasks.withType<LintBaseTask>().configureEach { | |
// doFirst is required else we get a Null Pointer Exception on lintOption | |
doFirst { | |
// This will override the lintOptions from the android extension | |
lintOptions.run { | |
if (name.toLowerCase().contains("debug")) { | |
// Do your configuration here | |
// isAbortOnError = false | |
// etc... | |
} |
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
<lint> | |
<issue id="UnusedAttribute" severity="warning"> | |
<!-- Ignore the specified issue if the location matched this path --> | |
<ignore path="**/AndroidManifest.xml"/> | |
<!-- Ignore the specified issue if the message or the location matches the regex --> | |
<ignore regexp="networkSecurityConfig"/> | |
<!-- path takes precedence over regexp so it's no use adding both --> | |
<!--<ignore path="**/AndroidManifest.xml" regexp="networkSecurityConfig"/>--> | |
</issue> |
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
lintOptions { | |
// aborts the build if an error is found | |
// severity is resolved at execution so once all the rules have been processed | |
isAbortOnError = true | |
// also check source code from included projects | |
isCheckDependencies = true | |
// automatically runs lint on release builds. If you run lint from your CI | |
// you can disable it here and save some time | |
isCheckReleaseBuilds = false | |
// also check the test sources |