build.gradle 3.66 KB
Newer Older
1 2 3 4
buildscript {
    repositories {
        mavenLocal()
        jcenter()
5
        maven { url "https://repo.spring.io/libs-milestone" }
6 7
    }
    dependencies {
Misagh Moayyed's avatar
Misagh Moayyed committed
8
        classpath "org.springframework.boot:spring-boot-gradle-plugin:${project.springBootVersion}"
9 10 11 12 13 14 15 16 17
    }
}

repositories {
    mavenLocal()
    mavenCentral()
    jcenter()
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
    maven { url 'https://build.shibboleth.net/nexus/content/repositories/releases/' }
18 19
    maven { url "https://repo.spring.io/milestone/" }
    maven { url "https://oss.jfrog.org/artifactory/oss-snapshot-local" }
20 21 22
}

apply from: "https://dl.bintray.com/scalding/generic/waroverlay.gradle"
Misagh Moayyed's avatar
Misagh Moayyed committed
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
apply plugin: "war"
apply plugin: "org.springframework.boot"
apply plugin: "eclipse"
apply plugin: "idea"


eclipse {
    classpath {
       downloadSources = true
       downloadJavadoc = true
    }
}

idea {
    module {
        downloadJavadoc = true
        downloadSources = true
    }
}

war {
    includeWarJars = true
    entryCompression = ZipEntryCompression.STORED
}

springBoot {
    mainClassName = "org.apereo.cas.web.CasWebApplication"
}

bootWar {
	if (project.hasProperty('executable')) {
    	launchScript()
	}

	archiveName 'cas.war'
    baseName 'cas'

    excludeDevtools = false
}

bootRun {
    sourceResources sourceSets.main
    classpath = sourceSets.main.runtimeClasspath
}

69 70 71 72 73
wrapper {
    distributionType = Wrapper.DistributionType.BIN
    gradleVersion = "${project.gradleVersion}"
}

74
dependencies {
Misagh Moayyed's avatar
Misagh Moayyed committed
75
    if (project.hasProperty("external")) {
76
        compile "org.apereo.cas:cas-server-webapp:${project.'cas.version'}"
Misagh Moayyed's avatar
Misagh Moayyed committed
77
    } else {
78
        compile "org.apereo.cas:cas-server-webapp${project.appServer}:${project.'cas.version'}"
Misagh Moayyed's avatar
Misagh Moayyed committed
79 80
    }
    // Other dependencies may be listed here...
81 82 83
}

task explodeWar(type: Copy, group: "build", description: "Explodes the cas.war") {
Misagh Moayyed's avatar
Misagh Moayyed committed
84 85 86
    dependsOn build
    from zipTree("build/libs/cas.war")
    into "${buildDir}/cas"
87 88 89 90 91
}

task run(group: "build", description: "Run the CAS web application in embedded container mode") {
    dependsOn build
    doLast {
92
        def casRunArgs = Arrays.asList("-Xmx2048M ".split(" "))
93
        javaexec {
94
            main = "-jar"
95 96 97 98 99 100 101
            jvmArgs = casRunArgs
            args = ["build/libs/cas.war"]
            logger.info "Started ${commandLine}"
        }
    }
}

Misagh Moayyed's avatar
Misagh Moayyed committed
102
task debug(group: "build", description: "Debug the CAS web application in embedded mode on port 5000") {
103 104
    dependsOn build
    doLast {
105
        def casDebugArgs = Arrays.asList("-Xmx2048M -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y".split(" "))
106
        javaexec {
107
            main = "-jar"
108 109 110 111 112 113 114 115 116
            jvmArgs = casDebugArgs
            args = ["build/libs/cas.war"]
            logger.info "Started ${commandLine}"
        }
    }
}

task casVersion(group: "build", description: "Display the current CAS version") {
    doFirst {
117
        println "${project.'cas.version'}"
118 119 120 121 122 123 124 125 126 127
    }
}

task showConfiguration(group: "build", description: "Show configurations for each dependency, etc") {
    doLast() {
        def cfg = project.hasProperty("configuration") ? project.property("configuration") : "compile"
        configurations.getByName(cfg).each { println it }
    }
}

128 129 130 131 132
task updateWrapper(description: "Update the Gradle wrapper") {
    println "Updating gradle wrapper to version specified in gradle.properties: ${project.gradleVersion}"
    dependsOn wrapper
}

133
task allDependenciesInsight(type: DependencyInsightReportTask, description: "Produce insight information for all dependencies") {}
Daniel Ramos's avatar
Daniel Ramos committed
134
task allDependencies(type: DependencyReportTask, description: "Display a graph of all project dependencies") {}