build.gradle 3.13 KB
Newer Older
duanledexianxianxian's avatar
duanledexianxianxian committed
1 2 3 4 5 6
allprojects {

    apply plugin: 'java'
    apply plugin: 'maven'
    apply plugin: 'com.novoda.bintray-release'

duanledexianxianxian's avatar
duanledexianxianxian committed
7 8
    group 'com.github.fengyuchenglun'
    version '1.0.0'
duanledexianxianxian's avatar
duanledexianxianxian committed
9 10 11 12 13 14 15 16 17 18 19 20

    sourceCompatibility = 1.8
    targetCompatibility = 1.8

    [compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'

    repositories {
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
    }

    dependencies {
        compile 'ch.qos.logback:logback-classic:1.2.3'
21
        compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'
duanledexianxianxian's avatar
duanledexianxianxian committed
22 23
        compile group: 'org.apache.commons', name: 'commons-collections4', version: '4.4'
        compileOnly 'org.projectlombok:lombok:1.18.6'
duanledexianxianxian's avatar
duanledexianxianxian committed
24 25 26 27 28 29 30 31
        annotationProcessor 'org.projectlombok:lombok:1.18.6'

        testCompileOnly 'org.projectlombok:lombok:1.18.4'
        testCompile group: 'junit', name: 'junit', version: '4.12'
    }

    ext {
        DESCRIPTION = 'A rest document generator with parse the source code.'
duanledexianxianxian's avatar
duanledexianxianxian committed
32 33
        SITE_URL = 'http://platform.kuopu.net:9999/gitlab/duanledexianxianxian/apidoc'
        GIT_URL = 'http://platform.kuopu.net:9999/gitlab/duanledexianxianxian/apidoc.git'
duanledexianxianxian's avatar
duanledexianxianxian committed
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103

        LICENSE = 'MIT License'

        DEVELOPER_ID = 'ayz6uem'
        DEVELOPER_NAME = 'ayz6uem'
        DEVELOPER_EMAIL = '360188606@qq.com'

        IS_UPLOADING = project.getGradle().startParameter.taskNames.any { it.contains('bintrayUpload') }
    }

    publish {
        userOrg = 'apidoc'
        groupId = group
        artifactId = name
        publishVersion = version
        desc = project.DESCRIPTION
        website = project.SITE_URL
//    bintrayUser = project.BINTRAYUSER
//    bintrayKey = project.BINTRAYKEY
        dryRun = false
    }
}

buildscript {
    repositories {
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
    }
    dependencies {
        classpath 'com.novoda:bintray-release:0.8.1'
    }
}

//
//gradle.taskGraph.whenReady { taskGraph ->
//    taskGraph.getAllTasks().find { it.path == ":generatePomFileForMavenPublication" }?.doLast {
//        file("build/publications/maven/pom-default.xml").delete()
//        println 'Overriding pom-file to make sure we can sync to maven!'
//        pom {
//            //noinspection GroovyAssignabilityCheck
//            project {
//                name "$project.name"
//                artifactId name
//                packaging 'jar'
//                description DESCRIPTION
//                url SITE_URL
//                version version
//
//                scm {
//                    url GIT_URL
//                    connection GIT_URL
//                    developerConnection GIT_URL
//                }
//
//                licenses {
//                    license {
//                        name LICENSE
//                    }
//                }
//
//                developers {
//                    developer {
//                        id DEVELOPER_ID
//                        name DEVELOPER_NAME
//                        email DEVELOPER_EMAIL
//                    }
//                }
//            }
//        }.writeTo("build/publications/maven/pom-default.xml")
//    }
//}