You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
148 lines
4.9 KiB
148 lines
4.9 KiB
apply plugin: 'com.android.library'
|
|
apply plugin: 'kotlin-android'
|
|
apply plugin: 'kotlin-android-extensions'
|
|
apply plugin: 'com.github.dcendents.android-maven'
|
|
apply plugin: 'com.jfrog.bintray'
|
|
apply plugin: 'org.jetbrains.dokka'
|
|
android {
|
|
compileSdkVersion 30
|
|
buildToolsVersion "30.0.2"
|
|
|
|
defaultConfig {
|
|
minSdkVersion 21
|
|
targetSdkVersion 30
|
|
versionCode 139
|
|
versionName "$libVersion"
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
consumerProguardFiles "consumer-rules.pro"
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
java {
|
|
include '**/*.java'
|
|
include '**/*.kt'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(dir: "libs", include: ["*.jar"])
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
implementation 'androidx.core:core-ktx:1.3.2'
|
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
|
api project(path: ':nsfw')
|
|
testImplementation 'junit:junit:4.12'
|
|
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
|
|
|
}
|
|
|
|
//group = "com.zwy.nsfw"
|
|
//publish {
|
|
// userOrg = 'devzwy'
|
|
// repoName = 'maven'
|
|
// artifactId = 'nsfw_initializer'
|
|
// desc = 'android端离线鉴黄库快速初始化库'
|
|
// website = 'https://github.com/devzwy'
|
|
//}
|
|
//
|
|
//tasks.withType(Javadoc) {//防止编码问题
|
|
// options.addStringOption('Xdoclint:none', '-quiet')
|
|
// options.addStringOption('encoding', 'UTF-8')
|
|
// options.addStringOption('charSet', 'UTF-8')
|
|
//}
|
|
|
|
version = "$libVersion"
|
|
def siteUrl = 'https://github.com/devzwy/open_nsfw_android' // 项目的主页(可以写自己的库的GitHub地址)
|
|
def gitUrl = 'https://github.com/devzwy/open_nsfw_android.git' // Git仓库的url 这个是说明,可随便填
|
|
group = "com.zwy.nsfw" // (**慎重填写**)这里是groupId ,必须填写 一般填你唯一的包名,对应com.squareup.okhttp3:okhttp:3.4.1中的com.squareup.okhttp3部分
|
|
|
|
install {
|
|
repositories.mavenInstaller {
|
|
pom {
|
|
project {
|
|
packaging 'aar'
|
|
name 'nsfw_initializer' //项目名字
|
|
url siteUrl
|
|
licenses {
|
|
license {
|
|
name = 'The Apache Software License, Version 2.0'
|
|
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
|
}
|
|
}
|
|
developers {
|
|
developer {
|
|
id 'z' //填写开发者的一些基本信息
|
|
name 'Jason' //填写开发者的一些基本信息
|
|
email 'dev_zwy@aliyun.com' //填写开发者的一些基本信息
|
|
}
|
|
}
|
|
scm {
|
|
connection gitUrl
|
|
developerConnection gitUrl
|
|
url siteUrl
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
task generateSourcesJar(type: Jar) {
|
|
group = 'jar'
|
|
from android.sourceSets.main.java.srcDirs
|
|
classifier = 'sources'
|
|
}
|
|
|
|
task sourcesJar(type: Jar) {
|
|
from android.sourceSets.main.java.srcDirs
|
|
classifier = 'sources'
|
|
}
|
|
task javadoc(type: Javadoc) {
|
|
source = android.sourceSets.main.java.srcDirs
|
|
options.encoding = "UTF-8"
|
|
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
|
|
}
|
|
task javadocJar(type: Jar, dependsOn: javadoc) {
|
|
classifier = 'javadoc'
|
|
from javadoc.destinationDir
|
|
}
|
|
task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
|
|
outputFormat = 'javadoc'
|
|
outputDirectory = javadoc.destinationDir
|
|
}
|
|
task generateJavadoc(type: Jar, dependsOn: dokkaJavadoc) {
|
|
group = 'jar'
|
|
classifier = 'javadoc'
|
|
from javadoc.destinationDir
|
|
}
|
|
|
|
artifacts {
|
|
archives generateJavadoc //javadocJar
|
|
archives generateSourcesJar //sourcesJar
|
|
}
|
|
|
|
Properties properties = new Properties()
|
|
properties.load(project.rootProject.file('local.properties').newDataInputStream())
|
|
bintray {
|
|
user = properties.getProperty("bintray.user") //读取 local.properties 文件里面的 bintray.user
|
|
key = properties.getProperty("bintray.apikey") //读取 local.properties 文件里面的 bintray.apikey
|
|
configurations = ['archives']
|
|
pkg {
|
|
repo = "maven" //(**慎重填写**)这里填写在bintray中自己新建仓库的名字
|
|
name = "nsfw_initializer" //(**慎重填写**)发布到JCenter上的项目名字,必须填写,对应com.squareup.okhttp3:okhttp:3.4.1中的okhttp
|
|
websiteUrl = siteUrl
|
|
vcsUrl = gitUrl
|
|
licenses = ["Apache-2.0"]
|
|
publish = true
|
|
desc = 'android端离线鉴黄库快速初始化库'
|
|
}
|
|
} |