mirror of
https://github.com/ankidroid/Anki-Android.git
synced 2024-09-20 03:52:15 +02:00
5f8c2f7938
* Bump junit_version from 5.9.0 to 5.9.1 Bumps `junit_version` from 5.9.0 to 5.9.1. Updates `junit-jupiter` from 5.9.0 to 5.9.1 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.9.0...r5.9.1) Updates `junit-vintage-engine` from 5.9.0 to 5.9.1 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.9.0...r5.9.1) Updates `junit-jupiter-params` from 5.9.0 to 5.9.1 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.9.0...r5.9.1) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.junit.vintage:junit-vintage-engine dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.junit.jupiter:junit-jupiter-params dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump annotation from 1.4.0 to 1.5.0 Bumps annotation from 1.4.0 to 1.5.0. --- updated-dependencies: - dependency-name: androidx.annotation:annotation dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump mockk from 1.12.8 to 1.13.1 Bumps [mockk](https://github.com/mockk/mockk) from 1.12.8 to 1.13.1. - [Release notes](https://github.com/mockk/mockk/releases) - [Commits](https://github.com/mockk/mockk/commits) --- updated-dependencies: - dependency-name: io.mockk:mockk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump activity-ktx from 1.5.1 to 1.6.0 Bumps activity-ktx from 1.5.1 to 1.6.0. --- updated-dependencies: - dependency-name: androidx.activity:activity-ktx dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump fragments_version from 1.5.2 to 1.5.3 Bumps `fragments_version` from 1.5.2 to 1.5.3. Updates `fragment-ktx` from 1.5.2 to 1.5.3 Updates `fragment-testing` from 1.5.2 to 1.5.3 --- updated-dependencies: - dependency-name: androidx.fragment:fragment-ktx dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: androidx.fragment:fragment-testing dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump mockk from 1.13.1 to 1.13.2 Bumps [mockk](https://github.com/mockk/mockk) from 1.13.1 to 1.13.2. - [Release notes](https://github.com/mockk/mockk/releases) - [Commits](https://github.com/mockk/mockk/compare/1.13.1...1.13.2) --- updated-dependencies: - dependency-name: io.mockk:mockk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump kotlin_version from 1.7.10 to 1.7.20 Bumps `kotlin_version` from 1.7.10 to 1.7.20. Updates `kotlin-gradle-plugin` from 1.7.10 to 1.7.20 - [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.7.10 to 1.7.20 - [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-test` from 1.7.10 to 1.7.20 - [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.7.10 to 1.7.20 - [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-test-junit5` from 1.7.10 to 1.7.20 - [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-test-junit` from 1.7.10 to 1.7.20 - [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-patch - dependency-name: org.jetbrains.kotlin:kotlin-stdlib dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-test 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 - dependency-name: org.jetbrains.kotlin:kotlin-test-junit5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-test-junit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
140 lines
4.4 KiB
Groovy
140 lines
4.4 KiB
Groovy
plugins {
|
|
id 'maven-publish'
|
|
id 'com.android.library'
|
|
id 'kotlin-android'
|
|
}
|
|
|
|
group = "com.ichi2.anki"
|
|
version = "2.0.0"
|
|
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
android {
|
|
compileSdkVersion 33
|
|
|
|
defaultConfig {
|
|
minSdkVersion 16
|
|
//noinspection OldTargetApi
|
|
targetSdkVersion 29
|
|
}
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
kotlinOptions {
|
|
// enable explicit api mode for additional checks related to the public api
|
|
// see https://kotlinlang.org/docs/whatsnew14.html#explicit-api-mode-for-library-authors
|
|
freeCompilerArgs += '-Xexplicit-api=strict'
|
|
}
|
|
}
|
|
|
|
apply from: "../lint.gradle"
|
|
|
|
dependencies {
|
|
implementation 'androidx.annotation:annotation:1.5.0'
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
testImplementation "org.junit.jupiter:junit-jupiter:$junit_version"
|
|
testImplementation "org.junit.vintage:junit-vintage-engine:$junit_version"
|
|
testImplementation 'org.robolectric:robolectric:4.8.2'
|
|
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
|
|
|
|
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/main/api'
|
|
licenses {
|
|
license {
|
|
name = 'GNU LESSER GENERAL PUBLIC LICENSE, v3'
|
|
url = 'https://github.com/ankidroid/Anki-Android/blob/main/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')
|
|
destinationDirectory = buildDir
|
|
archiveFileName = "${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)
|