build.gradle 2.88 KB
Newer Older
duanledexianxianxian's avatar
duanledexianxianxian committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 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
allprojects {

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

    group 'com.apidoc'
    version '1.7.0'

    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'

        compileOnly 'org.projectlombok:lombok:1.18.4'
        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.'
        SITE_URL = 'https://github.com/apigcc/apigcc'
        GIT_URL = 'https://github.com/apigcc/apigcc.git'

        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")
//    }
//}