apply plugin: 'com.android.library' apply plugin: 'maven-publish' // https://github.com/sky-uk/gradle-maven-plugin //apply from: "https://gitee.com/woyiqiankun/gradle-maven-plugin/raw/master/gradle-mavenizer.gradle" android { compileSdkVersion 32 buildToolsVersion "32.0.0" defaultConfig { minSdkVersion 19 targetSdkVersion 32 versionCode 122025 versionName "1.2202.5" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } task androidJavadocs(type: Javadoc) { failOnError false title = "hgsoftloglibrary ${project.version} API" description "Generates Javadoc" source = android.sourceSets.main.java.srcDirs classpath += files(android.bootClasspath) android.libraryVariants.all { variant -> if (variant.name == 'release') { owner.classpath += variant.javaCompileProvider.get().classpath } } exclude '**/R.html', '**/R.*.html', '**/index.html', '**/*.kt' options { windowTitle("hgsoftloglibrary ${project.version} Reference") locale = 'zh_CN' encoding = 'UTF-8' charSet = 'UTF-8' links("http://docs.oracle.com/javase/8/docs/api/") linksOffline("http://d.android.com/reference", "${android.sdkDirectory}/docs/reference") setMemberLevel(JavadocMemberLevel.PUBLIC) } } task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { archiveClassifier.convention('javadoc') archiveClassifier.set('javadoc') from androidJavadocs.destinationDir } task androidSourcesJar(type: Jar) { archiveClassifier.convention('sources') archiveClassifier.set('sources') from android.sourceSets.main.java.srcDirs } afterEvaluate { publishing { publications { // Creates a Maven publication called "release". mavenPublish(MavenPublication) { // Applies the component for the release build variant. from components.release artifact androidSourcesJar artifact androidJavadocsJar // You can then customize attributes of the publication as shown below. groupId = 'com.hgsoft.app' artifactId = 'loglibrary' version = '1.2202.5' } } repositories { maven { credentials { username 'yinxueqin' password 'hgits1024' } url = 'https://nexus.hgits.cn/nexus/repository/hgsoft/' } } repositories { maven { credentials { username '60de898e6da2f73831c32a9d' password 'G-O=rDpLTK7B' } url = 'https://packages.aliyun.com/maven/repository/2117453-release-bMZITa/' } } } } //project.ext { // // 填你的名字 // mavDevelopers = ["Ch":"yinxueqin"] // // 项目的网址,没有就填svn地址 // mavSiteUrl = "http://svn.hgits.cn:81/svn/研发资料/创新研究院/研发中心/端组APP/03.公共模块/01 Android和IOS日志模块/代码参考/loglibrary" // // 填svn或者git地址 // mavGitUrl = "http://svn.hgits.cn:81/svn/研发资料/创新研究院/研发中心/端组APP/03.公共模块/01 Android和IOS日志模块/代码参考/loglibrary" // // 填项目名称 // mavProjectName = 'hgsoftloglibrary' // // 填GroupId,相对唯一 // mavProjectGroup = "hgits.cn" // // 填ArtifactId,相对唯一 // mavProjectArtifact = "hgsoftloglibrary" // // 包的版本号 // mavProjectVersion = "1.2100.1" // // 填true // mavPublishToRemoteRepo = true // // 填用户名 // mavRemoteRepoUser = "admin" // // 填对应的用户密码 // mavRemoteRepoPassword = "nexus_hgits" // // 固定此地址 // mavRepoRemoteUrl = "http://218.107.19.106:19999/repository/apphgits/" //} dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) compileOnly 'androidx.appcompat:appcompat:1.4.2' api 'com.tencent.mars:mars-xlog:1.2.6' api 'net.lingala.zip4j:zip4j:2.1.3' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' }