Skip to content

Commit

Permalink
update gradle config
Browse files Browse the repository at this point in the history
  • Loading branch information
bdqfork committed Feb 22, 2020
1 parent 20fddf1 commit 3ed6521
Show file tree
Hide file tree
Showing 13 changed files with 95 additions and 37 deletions.
46 changes: 31 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@ ext {
buildscript {
ext.kotlin_version = '1.3.61'
ext.shadow_version = '5.2.0'
ext.dokka_version = '0.10.1'
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
maven {
url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'
}
}

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.github.jengelman.gradle.plugins:shadow:$shadow_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
}
}

Expand All @@ -37,14 +41,19 @@ allprojects {
}

subprojects {
apply plugin: 'kotlin'
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'org.jetbrains.dokka'

repositories {
mavenLocal()
maven {
url = 'http://repo.maven.apache.org/maven2'
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
maven {
url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'
}
}

Expand All @@ -58,31 +67,38 @@ subprojects {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'

task sourcesJar(type: Jar) {
from sourceSets.main.allJava
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}

task generateSourcesJar(type: Jar) {
group = 'jar'
from sourceSets.main.java.srcDirs
classifier = 'sources'
}

task javadocJar(type: Jar) {
from javadoc
classifier = 'javadoc'
task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = "javadoc"
outputDirectory = javadoc.destinationDir
}

tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
task generateJavadoc(type: Jar, dependsOn: dokkaJavadoc) {
group = 'jar'
classifier = 'javadoc'
from javadoc.destinationDir
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
artifact generateSourcesJar
artifact generateJavadoc
pom {
name = project.name
description = project.name
url = 'https://github.com/bdqfork/festival'
licenses {
license {
Expand Down
10 changes: 10 additions & 0 deletions festival-aop/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,13 @@ dependencies {
api "org.aspectj:aspectjweaver:${libs.aspectjweaver}"
implementation project(':festival-context')
}

publishing {
publications {
mavenJava(MavenPublication) {
pom {
description = 'Aop extension for festival context!'
}
}
}
}
19 changes: 10 additions & 9 deletions festival-cache/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
apply plugin: 'kotlin'

def libs = rootProject.ext.libraries

dependencies {
Expand All @@ -8,13 +6,6 @@ dependencies {
implementation project(':festival-context')
}

compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}

tasks.withType(PublishToMavenRepository) {
onlyIf {
false
Expand All @@ -24,4 +15,14 @@ tasks.withType(PublishToMavenLocal) {
onlyIf {
false
}
}

publishing {
publications {
mavenJava(MavenPublication) {
pom {
description = 'Cache extension for festival context!'
}
}
}
}
10 changes: 10 additions & 0 deletions festival-context/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,13 @@ dependencies {
api project(':festival-core')
testImplementation project(':festival-aop')
}

publishing {
publications {
mavenJava(MavenPublication) {
pom {
description = 'Application context based on festival core!'
}
}
}
}
10 changes: 10 additions & 0 deletions festival-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,14 @@ def libs = rootProject.ext.libraries
dependencies {
api "javax.inject:javax.inject:${libs.jsr330}"
implementation "org.javassist:javassist:${libs.javassist}"
}

publishing {
publications {
mavenJava(MavenPublication) {
pom {
description = 'IoC core factories!'
}
}
}
}
15 changes: 8 additions & 7 deletions festival-kotlin-web/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
apply plugin: 'kotlin'

def libs = rootProject.ext.libraries

dependencies {
Expand All @@ -15,9 +13,12 @@ dependencies {
api project(':festival-context')
}

compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
publishing {
publications {
mavenJava(MavenPublication) {
pom {
description = 'A kotlin web framework based vertx!'
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ package cn.bdqfork.kotlin.web.annotation
*/
@MustBeDocumented
@kotlin.annotation.Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
annotation class Auth
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ import javax.inject.Singleton
@Named
@MustBeDocumented
@kotlin.annotation.Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS)
@Target(AnnotationTarget.CLASS)
annotation class VerticleMapping(val value: String = "")
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ import io.vertx.ext.web.handler.TimeoutHandler
@RouteMapping(method = HttpMethod.PUT)
@MustBeDocumented
@kotlin.annotation.Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.FUNCTION)
@Target(AnnotationTarget.FUNCTION)
annotation class PutMapping(val value: String, val timeout: Long = TimeoutHandler.DEFAULT_TIMEOUT)
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ import javax.inject.Named
@RouteMapping
@MustBeDocumented
@kotlin.annotation.Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS)
@Target(AnnotationTarget.CLASS)
annotation class RouteController(val value: String = "")
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ import io.vertx.ext.web.handler.TimeoutHandler
*/
@MustBeDocumented
@kotlin.annotation.Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
annotation class RouteMapping(val value: String = "", val method: HttpMethod = HttpMethod.OPTIONS, val timeout: Long = TimeoutHandler.DEFAULT_TIMEOUT)
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ package cn.bdqfork.kotlin.web.route.annotation
*/
@MustBeDocumented
@kotlin.annotation.Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS)
@Target(AnnotationTarget.CLASS)
annotation class ServerEndpoint(val value: String)
10 changes: 10 additions & 0 deletions festival-web/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,14 @@ dependencies {
api "io.vertx:vertx-web:${libs.vertx}"
api "io.vertx:vertx-rx-java2:${libs.vertx}"
api project(':festival-context')
}

publishing {
publications {
mavenJava(MavenPublication) {
pom {
description = 'A web framework based vertx!'
}
}
}
}

0 comments on commit 3ed6521

Please sign in to comment.