0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 03:52:15 +02:00
Anki-Android/api/build.gradle
Mike Hardy 3fcfcc9957
Dependency updates 20211118 (#9932)
* build(deps): bump material-tap-target-prompt from 3.3.0 to 3.3.1

Bumps [material-tap-target-prompt](https://github.com/sjwall/MaterialTapTargetPrompt) from 3.3.0 to 3.3.1.
- [Release notes](https://github.com/sjwall/MaterialTapTargetPrompt/releases)
- [Changelog](https://github.com/sjwall/MaterialTapTargetPrompt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sjwall/MaterialTapTargetPrompt/compare/v3.3.0...v3.3.1)

---
updated-dependencies:
- dependency-name: uk.co.samuelwall:material-tap-target-prompt
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump material-tap-target-prompt from 3.3.1 to 3.3.2

Bumps [material-tap-target-prompt](https://github.com/sjwall/MaterialTapTargetPrompt) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/sjwall/MaterialTapTargetPrompt/releases)
- [Changelog](https://github.com/sjwall/MaterialTapTargetPrompt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sjwall/MaterialTapTargetPrompt/compare/v3.3.1...v3.3.2)

---
updated-dependencies:
- dependency-name: uk.co.samuelwall:material-tap-target-prompt
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump annotations from 22.0.0 to 23.0.0 (#9869)

* Bump annotations from 22.0.0 to 23.0.0

Bumps [annotations](https://github.com/JetBrains/java-annotations) from 22.0.0 to 23.0.0.
- [Release notes](https://github.com/JetBrains/java-annotations/releases)
- [Changelog](https://github.com/JetBrains/java-annotations/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JetBrains/java-annotations/compare/22.0.0...23.0.0)

---
updated-dependencies:
- dependency-name: org.jetbrains:annotations
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump robolectric from 4.6.1 to 4.7

Bumps [robolectric](https://github.com/robolectric/robolectric) from 4.6.1 to 4.7.
- [Release notes](https://github.com/robolectric/robolectric/releases)
- [Commits](https://github.com/robolectric/robolectric/compare/robolectric-4.6.1...robolectric-4.7)

---
updated-dependencies:
- dependency-name: org.robolectric:robolectric
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(test): Kotlin 1.6 requires exhaustive `when`, fix TagsDialogTest

* Bump kotlin_version from 1.5.31 to 1.6.0

Bumps `kotlin_version` from 1.5.31 to 1.6.0.

Updates `kotlin-gradle-plugin` from 1.5.31 to 1.6.0
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `kotlin-stdlib` from 1.5.31 to 1.6.0
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `kotlin-stdlib-jdk7` from 1.5.31 to 1.6.0
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `kotlin-reflect` from 1.5.31 to 1.6.0
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-gradle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.jetbrains.kotlin:kotlin-stdlib
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.jetbrains.kotlin:kotlin-stdlib-jdk7
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.jetbrains.kotlin:kotlin-reflect
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump robolectric from 4.7 to 4.7.1

Bumps [robolectric](https://github.com/robolectric/robolectric) from 4.7 to 4.7.1.
- [Release notes](https://github.com/robolectric/robolectric/releases)
- [Commits](https://github.com/robolectric/robolectric/compare/robolectric-4.7...robolectric-4.7.1)

---
updated-dependencies:
- dependency-name: org.robolectric:robolectric
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump appcompat from 1.3.1 to 1.4.0

fix: androidx.appcompat.resources.R.layout no longer exists

Bumps appcompat from 1.3.1 to 1.4.0.

---
updated-dependencies:
- dependency-name: androidx.appcompat:appcompat
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(lint): add copyright

* Bump fragment-ktx from 1.3.6 to 1.4.0

Bumps fragment-ktx from 1.3.6 to 1.4.0.

Note: https://issuetracker.google.com/issues/206855622 requires ignoring ObsoleteLintCustomCheck for now

---
updated-dependencies:
- dependency-name: androidx.fragment:fragment-ktx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump fragment-testing from 1.3.6 to 1.4.0

Bumps fragment-testing from 1.3.6 to 1.4.0.

---
updated-dependencies:
- dependency-name: androidx.fragment:fragment-testing
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Allison <62114487+david-allison-1@users.noreply.github.com>
2021-11-18 19:33:55 -05:00

160 lines
5.0 KiB
Groovy

plugins {
id 'maven-publish'
id 'com.android.library'
id 'kotlin-android'
}
group = "com.ichi2.anki"
version = "1.1.0"
repositories {
google()
mavenCentral()
}
android {
compileSdkVersion 31
defaultConfig {
minSdkVersion 14
//noinspection OldTargetApi
targetSdkVersion 29
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
testOptions.unitTests.all {
testLogging {
events "failed", "skipped"
showStackTraces = true
exceptionFormat = "full"
}
maxParallelForks = gradleTestMaxParallelForks
systemProperties['junit.jupiter.execution.parallel.enabled'] = true
systemProperties['junit.jupiter.execution.parallel.mode.default'] = "concurrent"
}
}
apply from: "../lint.gradle"
dependencies {
implementation 'androidx.annotation:annotation:1.3.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testImplementation 'org.junit.vintage:junit-vintage-engine:5.8.1'
testImplementation 'org.robolectric:robolectric:4.7.1'
lintChecks project(":lint-rules")
}
task androidSourcesJar(type: Jar) {
archiveClassifier.set('sources')
// For Android libraries
from android.sourceSets.main.java.srcDirs
}
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
android.libraryVariants.all { variant ->
if (variant.name == 'release') {
owner.classpath += variant.javaCompileProvider.get().classpath
}
}
exclude '**/R.html', '**/R.*.html', '**/index.html'
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
archiveClassifier.set('javadoc')
from androidJavadocs.destinationDir
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = "api"
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
artifact androidSourcesJar
artifact androidJavadocsJar
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'AnkiDroid API'
description = 'A programmatic API exported by AnkiDroid'
url = 'https://github.com/ankidroid/Anki-Android/tree/master/api'
licenses {
license {
name = 'GNU LESSER GENERAL PUBLIC LICENSE, v3'
url = 'https://github.com/ankidroid/Anki-Android/blob/master/api/COPYING.LESSER'
}
}
scm {
connection = 'scm:git:git://github.com/ankidroid/Anki-Android.git'
url = 'https://github.com/ankidroid/Anki-Android'
}
}
}
}
repositories {
maven {
// change URLs to point to your repos, e.g. http://my.org/repo
def releasesRepoUrl = layout.buildDirectory.dir('repos/releases')
def snapshotsRepoUrl = layout.buildDirectory.dir('repos/snapshots')
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
task zipRelease(type: Zip) {
from layout.buildDirectory.dir('repos/releases')
destinationDir buildDir
archiveName "${buildDir}/release-${archiveVersion.get()}.zip"
}
// Use this task to make a release you can send to someone
// You may like `./gradlew :api:publishToMavenLocal for development
task generateRelease {
doLast {
println "Release ${version} can be found at ${buildDir}/repos/releases/"
println "Release ${version} zipped can be found ${buildDir}/release-${version}.zip"
}
}
publishMavenJavaPublicationToMavenRepository.dependsOn(assemble)
publish.dependsOn(assemble)
generateRelease.dependsOn(publish)
generateRelease.dependsOn(zipRelease)
// Deprecation is an error. Use @SuppressWarnings("deprecation") and justify in the PR if you must
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation" << "-Xmaxwarns" << "1000" << "-Werror"
// https://guides.gradle.org/performance/#compiling_java
// 1- fork improves things over time with repeated builds, doesn't harm CI single builds
options.fork = true
// 2- incremental will be the default in the future and can help now
options.incremental = true
}