mirror of
https://github.com/ankidroid/Anki-Android.git
synced 2024-09-20 03:52:15 +02:00
417160f919
* Bump mockito-inline from 4.0.0 to 4.1.0 (#9940) Bumps [mockito-inline](https://github.com/mockito/mockito) from 4.0.0 to 4.1.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v4.0.0...v4.1.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-inline 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> * Bump okhttp from 4.9.2 to 4.9.3 Bumps [okhttp](https://github.com/square/okhttp) from 4.9.2 to 4.9.3. - [Release notes](https://github.com/square/okhttp/releases) - [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md) - [Commits](https://github.com/square/okhttp/compare/parent-4.9.2...parent-4.9.3) --- updated-dependencies: - dependency-name: com.squareup.okhttp3:okhttp dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump constraintlayout from 2.1.1 to 2.1.2 Bumps [constraintlayout](https://github.com/androidx/constraintlayout) from 2.1.1 to 2.1.2. - [Release notes](https://github.com/androidx/constraintlayout/releases) - [Commits](https://github.com/androidx/constraintlayout/commits) --- updated-dependencies: - dependency-name: androidx.constraintlayout:constraintlayout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump com.github.triplet.play from 3.6.0 to 3.7.0 Bumps com.github.triplet.play from 3.6.0 to 3.7.0. --- updated-dependencies: - dependency-name: com.github.triplet.play dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump lint_version from 30.0.3 to 30.0.4 (#9972) Bumps `lint_version` from 30.0.3 to 30.0.4. Updates `lint-api` from 30.0.3 to 30.0.4 Updates `lint` from 30.0.3 to 30.0.4 Updates `lint-tests` from 30.0.3 to 30.0.4 --- updated-dependencies: - dependency-name: com.android.tools.lint:lint-api dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.android.tools.lint:lint dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.android.tools.lint:lint-tests dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump gradle from 7.0.3 to 7.0.4 (#9973) Bumps gradle from 7.0.3 to 7.0.4. --- updated-dependencies: - dependency-name: com.android.tools.build:gradle dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump kotlin_version from 1.6.0 to 1.6.10 (#9980) Bumps `kotlin_version` from 1.6.0 to 1.6.10. Updates `kotlin-gradle-plugin` from 1.6.0 to 1.6.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.6.10/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.6.0...v1.6.10) Updates `kotlin-stdlib` from 1.6.0 to 1.6.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.6.10/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.6.0...v1.6.10) Updates `kotlin-stdlib-jdk7` from 1.6.0 to 1.6.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.6.10/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.6.0...v1.6.10) Updates `kotlin-reflect` from 1.6.0 to 1.6.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.6.10/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.6.0...v1.6.10) --- updated-dependencies: - dependency-name: org.jetbrains.kotlin:kotlin-gradle-plugin dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-stdlib dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-stdlib-jdk7 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-reflect dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump sqlite-framework from 2.1.0 to 2.2.0 Bumps sqlite-framework from 2.1.0 to 2.2.0. --- updated-dependencies: - dependency-name: androidx.sqlite:sqlite-framework dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump mockito-inline from 4.1.0 to 4.2.0 Bumps [mockito-inline](https://github.com/mockito/mockito) from 4.1.0 to 4.2.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v4.1.0...v4.2.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-inline dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump junit-vintage-engine from 5.8.1 to 5.8.2 Bumps [junit-vintage-engine](https://github.com/junit-team/junit5) from 5.8.1 to 5.8.2. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.8.1...r5.8.2) --- updated-dependencies: - dependency-name: org.junit.vintage:junit-vintage-engine dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
160 lines
5.0 KiB
Groovy
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.2'
|
|
testImplementation 'org.robolectric:robolectric:4.7.3'
|
|
|
|
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
|
|
}
|