Skip to content

Commit

Permalink
修改readme
Browse files Browse the repository at this point in the history
修改dokka
  • Loading branch information
Ayvytr committed Dec 22, 2019
1 parent d8a9f33 commit 48dafc8
Show file tree
Hide file tree
Showing 8 changed files with 246 additions and 39 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![jCenter](https://img.shields.io/badge/jCenter-2.4.3-red.svg)](https://bintray.com/ayvytr/maven/ktx/_latestVersion)
[![jCenter](https://img.shields.io/badge/jCenter-2.5.0-red.svg)](https://bintray.com/ayvytr/maven/ktx/_latestVersion)
[![License](https://img.shields.io/badge/License-Apache--2.0%20-blue.svg)](license)

Ktx:简化Android开发的Kotlin库
Expand All @@ -8,19 +8,22 @@ Ktx:简化Android开发的Kotlin库
android

```
implementation 'com.ayvytr:ktx:2.4.3'
implementation 'com.ayvytr:ktx:2.5.0'
```

androidx

```
implementation 'com.ayvytr:ktx-androidx:2.4.3'
implementation 'com.ayvytr:ktx-androidx:2.5.0'
```



## ChangeLog

### 2.5.0
增加Spanner工具类,为TextView提供简单易用的SpannableString

### 2.4.3
精简工具类
增加Fragment getStringArray等方法
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {

defaultConfig {
applicationId "com.ayvytr.easykotlinproject"
minSdkVersion 15
minSdkVersion 19
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
Expand Down
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply from: "https://raw.github.com/Ayvytr/GlobalConfig/master/gradle/sdk27.gradle"
//apply from: 'https://raw.githubusercontent.com/Ayvytr/GlobalConfig/master/gradle/sdk27.gradle'
apply from: 'sdk27.gradle'

buildscript {
ext.kotlin_version = '1.3.50'
ext.anko_version = '0.10.6'
ext.dokka_version = '0.9.17'
ext.dokka_version = '0.10.0'
repositories {
google()
jcenter()
Expand All @@ -19,8 +20,8 @@ buildscript {
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'

// classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}"
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:${dokka_version}"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}"
// classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:${dokka_version}"
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#android.useAndroidX=true
#android.enableJetifier=true

PROJ_VERSION=2.4.3
PROJ_VERSION=2.5.0
PROJ_GROUP=com.ayvytr

PROJ_WEBSITEURL=https://github.com/Ayvytr/ktx.git
Expand Down
163 changes: 163 additions & 0 deletions kotlin_maven_push.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
apply plugin: 'org.jetbrains.dokka'

group = PROJ_GROUP

// Both the artifactory and bintray plugins depend on this singular
// global `version` variable. As such, we need to configure it based
// on which task we're running.
//
// The solution here is brittle; it just checks whether 'bintrayUpload'
// was called for execution, otherwise it assumes SNAPSHOT. If we
// were to wait until the task graph was built, we'd be too late
// (the plugins would already have used `version`).
version = PROJ_VERSION

// Create source/javadoc artifacts for publishing
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

//same as your project
def outputDir = "$buildDir/javadoc"

//append these code under your module 'build.gradle', before
//apply from: 'https://raw.github.com/Ayvytr/KotlinJavadocMavenPush/master/kotlin_maven_push.gradle'
//if not, it will be error
//task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
// outputFormat = 'javadoc'
// outputDirectory = "$buildDir/javadoc"
//
// // Do not create index pages for empty packages
// skipEmptyPackages = true
//
// //Do not output deprecated members. Applies globally, can be overridden by packageOptions
// skipDeprecated = false
//
// //No default documentation link to kotlin-stdlib
// noStdlibLink = false
//}

dokka {
outputDirectory = "$buildDir/javadoc"
outputFormat = "javadoc"

configuration {

// Disable linking to online kotlin-stdlib documentation
noStdlibLink = false

// Disable linking to online JDK documentation
noJdkLink = false
}
}


task javadocJar(type: Jar, dependsOn: dokka) {
classifier = 'javadoc'
from outputDir
}


artifacts {
archives javadocJar
archives sourcesJar
}

// Configure android-maven-gradle-plugin
install {
repositories.mavenInstaller.pom.project {
name PROJ_NAME
description PROJ_DESCRIPTION
packaging 'aar'
url PROJ_WEBSITEURL

licenses {
license {
name POM_LICENCE_NAME
url POM_LICENCE_URL
distribution POM_LICENCE_DIST
}
}

scm {
url POM_SCM_URL
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEV_CONNECTION

}

developers {
developer {
id DEVELOPER_ID
name DEVELOPER_NAME
email DEVELOPER_EMAIL
}
}
}
}

// Configure gradle-bintray-plugin (for publishing releases)
bintray {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

user = properties.getProperty('BINTRAY_USER')
key = properties.getProperty('BINTRAY_KEY')
if (user == null || key == null) {
throw new NullPointerException("[Message] upload.gradle: BINTRAY_USER or BINTRAY_KEY in local.properties is null!")
}

configurations = ['archives']
publications = ['mavenJava']
publish = true

pkg {
repo = 'maven'
name = PROJ_NAME
desc = PROJ_DESCRIPTION
websiteUrl = PROJ_WEBSITEURL
issueTrackerUrl = PROJ_ISSUETRACKERURL
vcsUrl = PROJ_VCSURL
licenses = ['Apache-2.0']
publicDownloadNumbers = true
labels = [PROJ_NAME]
}
}

publishing {
publications {
mavenJava(MavenPublication) {
pom {
packaging 'aar'
}
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
// Iterate over the implementation dependencies (we don't want the test ones), adding a <dependency> node for each
configurations.implementation.allDependencies.each {
// Ensure dependencies such as fileTree are not included.
if (it.name != 'unspecified') {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)

if (it.group.contains("junit") || it.group.contains("com.android.support.test")) {
dependencyNode.appendNode('scope', 'test')
} else if (it.group.contains("com.android.support") || it.group.contains("androidx.")) {
dependencyNode.appendNode('scope', 'runtime')
} else {
dependencyNode.appendNode('scope', 'compile')
}
// if (it instanceof ModuleDependency) {
// dependencyNode.appendNode('scope', 'runtime')
// }
}
}
}
}
}
}
31 changes: 16 additions & 15 deletions ktx-androidx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,19 @@ dependencies {
}


task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaAndroidTask) {
outputFormat = 'javadoc'
outputDirectory = "$buildDir/javadoc"

// Do not create index pages for empty packages
skipEmptyPackages = true

//Do not output deprecated members. Applies globally, can be overridden by packageOptions
skipDeprecated = false

//No default documentation link to kotlin-stdlib
noStdlibLink = false
}

apply from: 'https://raw.github.com/Ayvytr/GlobalConfig/master/gradle/kotlin_maven_push.gradle'
//task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaAndroidTask) {
// outputFormat = 'javadoc'
// outputDirectory = "$buildDir/javadoc"
//
// // Do not create index pages for empty packages
// skipEmptyPackages = true
//
// //Do not output deprecated members. Applies globally, can be overridden by packageOptions
// skipDeprecated = false
//
// //No default documentation link to kotlin-stdlib
// noStdlibLink = false
//}

//apply from: 'https://raw.githubusercontent.com/Ayvytr/GlobalConfig/master/gradle/kotlin_maven_push.gradle'
apply from: '../kotlin_maven_push.gradle'
31 changes: 16 additions & 15 deletions ktx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,19 @@ dependencies {
}


task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaAndroidTask) {
outputFormat = 'javadoc'
outputDirectory = "$buildDir/javadoc"

// Do not create index pages for empty packages
skipEmptyPackages = true

//Do not output deprecated members. Applies globally, can be overridden by packageOptions
skipDeprecated = false

//No default documentation link to kotlin-stdlib
noStdlibLink = false
}

apply from: 'https://raw.github.com/Ayvytr/GlobalConfig/master/gradle/kotlin_maven_push.gradle'
//task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaAndroidTask) {
// outputFormat = 'javadoc'
// outputDirectory = "$buildDir/javadoc"
//
// // Do not create index pages for empty packages
// skipEmptyPackages = true
//
// //Do not output deprecated members. Applies globally, can be overridden by packageOptions
// skipDeprecated = false
//
// //No default documentation link to kotlin-stdlib
// noStdlibLink = false
//}

//apply from: 'https://raw.github.com/Ayvytr/GlobalConfig/master/gradle/kotlin_maven_push.gradle'
apply from: '../kotlin_maven_push.gradle'
38 changes: 38 additions & 0 deletions sdk27.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
ext {

compileSdkVersion = 27
targetSdkVersion = 26

supportLibraryVersion = "27.1.1"

version = [
constraint: "1.1.3",
multidex : "1.0.3",
]

support = [
appcompat_v7: "com.android.support:appcompat-v7:$supportLibraryVersion",
recyclerview: "com.android.support:recyclerview-v7:$supportLibraryVersion",
constraint : "com.android.support.constraint:constraint-layout:$version.constraint",
design : "com.android.support:design:$supportLibraryVersion",
cardview : "com.android.support:cardview-v7:$supportLibraryVersion",
palette : "com.android.support:palette-v7:$supportLibraryVersion",
support_v4 : "com.android.support:support-v4:$supportLibraryVersion",
annotations : "com.android.support:support-annotations:$supportLibraryVersion",
multidex : "com.android.support:multidex:$version.multidex",
]

test = [
junit : "junit:junit:4.12",
testRunner: "com.android.support.test:runner:1.0.2",
espresso : "com.android.support.test.espresso:espresso-core:3.0.2",
]

kotlin = [
kotlin_jdk7 : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version",
anko : "org.jetbrains.anko:anko:$anko_version",
anko_commons : "org.jetbrains.anko:anko-commons:$anko_version",

rxlifecycle_android: 'com.trello.rxlifecycle2:rxlifecycle-android-lifecycle-kotlin:2.2.2',
]
}

0 comments on commit 48dafc8

Please sign in to comment.