|
| 1 | +buildscript { |
| 2 | + repositories { |
| 3 | + mavenLocal() |
| 4 | + maven { url ossimMavenProxy } |
| 5 | + } |
| 6 | + dependencies { |
| 7 | + classpath "org.grails:grails-gradle-plugin:$grailsVersion" |
| 8 | + classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}" |
| 9 | + classpath "com.bertramlabs.plugins:asset-pipeline-gradle:${assetPipelineGradleV}" |
| 10 | + classpath "net.errbuddy.plugins:babel-asset-pipeline:2.1.1" |
| 11 | + classpath "io.ossim:gradleDefaults:${gradleDefaultsV}" |
| 12 | + } |
| 13 | +} |
| 14 | + |
| 15 | +plugins { |
| 16 | + id "com.github.ben-manes.versions" version "0.21.0" |
| 17 | + // id "org.sonarqube" version "2.6.2" |
| 18 | +} |
| 19 | + |
| 20 | +subprojects { project -> |
| 21 | + boolean isGrailsApp = project.name.endsWith( '-app' ) |
| 22 | + boolean isGrailsPlugin = project.name.endsWith( '-plugin' ) |
| 23 | + boolean isGrailsProject = isGrailsApp || isGrailsPlugin |
| 24 | + |
| 25 | + if ( isGrailsProject ) |
| 26 | + { |
| 27 | + apply plugin: "eclipse" |
| 28 | + apply plugin: "idea" |
| 29 | + |
| 30 | + if ( isGrailsApp ) |
| 31 | + { |
| 32 | + apply plugin: "org.grails.grails-web" |
| 33 | + } |
| 34 | + else if ( isGrailsPlugin ) |
| 35 | + { |
| 36 | + apply plugin: "org.grails.grails-plugin" |
| 37 | + apply plugin: "org.grails.grails-plugin-publish" |
| 38 | + apply plugin: "maven-publish" |
| 39 | + } |
| 40 | + |
| 41 | + apply plugin: "org.grails.grails-gsp" |
| 42 | + apply plugin: "asset-pipeline" |
| 43 | + apply plugin: "java" |
| 44 | + |
| 45 | + |
| 46 | + io.ossim.gradleDefaults.Variables.setAdditionalVariables(project) |
| 47 | + io.ossim.gradleDefaults.Variables.setVersionVariables(project) |
| 48 | + version "${buildVersion}-${buildVersionTag}" |
| 49 | + |
| 50 | + if ( isGrailsApp ) |
| 51 | + { |
| 52 | + dockerBuildDir="${rootProject.projectDir}/docker" |
| 53 | + jarDestination = "${project.projectDir}/build/libs/${project.name}-${version}.jar" |
| 54 | + io.ossim.gradleDefaults.Docker.addDockerTasks(project, dockerRegistryUrl, dockerRegistryUsername, dockerRegistryPassword, name, dockerImageTag, dockerBuildDir, jarDestination, ["BASE_IMAGE": "${dockerRegistryUrl}/${dockerBaseImage}:${dockerFromTag}"]) |
| 55 | + io.ossim.gradleDefaults.Openshift.addOpenshiftTasks(project, openshiftUrl, openshiftUsername, openshiftPassword, openshiftProjectName, openshiftServiceName, dockerRegistryUrl, name, dockerImageTag) |
| 56 | + } |
| 57 | + else if ( isGrailsPlugin ) |
| 58 | + { |
| 59 | + sourceSets.main.output.classesDir = 'build/classes/groovy/main' |
| 60 | + jarDestination = "${project.projectDir}/build/libs/${project.name}-${version}.jar" |
| 61 | + io.ossim.gradleDefaults.Publications.addPublication(project, groupName, name, "${buildVersion}-${buildVersionTag}") |
| 62 | + io.ossim.gradleDefaults.Publications.addRepository(project, mavenPublishUrl, mavenRepoUsername, mavenRepoPassword) |
| 63 | + } |
| 64 | + |
| 65 | + repositories { |
| 66 | + mavenLocal() |
| 67 | + maven { url ossimMavenProxy } |
| 68 | + } |
| 69 | + |
| 70 | + dependencyManagement { |
| 71 | + imports { |
| 72 | + mavenBom "org.springframework.cloud:spring-cloud-starter-parent:${springCloudDependencyV}" |
| 73 | + } |
| 74 | + applyMavenExclusions false |
| 75 | + } |
| 76 | + |
| 77 | + dependencies { |
| 78 | + compile "org.springframework.boot:spring-boot-starter-logging" |
| 79 | + compile "org.springframework.boot:spring-boot-autoconfigure" |
| 80 | + compile "org.grails:grails-core" |
| 81 | + compile "org.springframework.boot:spring-boot-starter-actuator" |
| 82 | + compile "org.springframework.boot:spring-boot-starter-tomcat" |
| 83 | + compile "org.grails:grails-web-boot" |
| 84 | + compile "org.grails:grails-logging" |
| 85 | + compile "org.grails:grails-plugin-rest" |
| 86 | + compile "org.grails:grails-plugin-databinding" |
| 87 | + compile "org.grails:grails-plugin-i18n" |
| 88 | + compile "org.grails:grails-plugin-services" |
| 89 | + compile "org.grails:grails-plugin-url-mappings" |
| 90 | + compile "org.grails:grails-plugin-interceptors" |
| 91 | + compile "org.grails.plugins:cache" |
| 92 | + compile "org.grails.plugins:async" |
| 93 | + compile "org.grails.plugins:scaffolding" |
| 94 | + compile "org.grails.plugins:gsp" |
| 95 | + console "org.grails:grails-console" |
| 96 | + runtime "com.bertramlabs.plugins:asset-pipeline-grails:${assetPipelineGrailsV}" |
| 97 | + testCompile "org.grails:grails-gorm-testing-support" |
| 98 | + testCompile "org.grails:grails-web-testing-support" |
| 99 | + testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:${seleniumHtmlUnitDriverV}" |
| 100 | + testRuntime "net.sourceforge.htmlunit:htmlunit:${htmlUnitV}" |
| 101 | + testCompile "org.grails.plugins:geb" |
| 102 | + |
| 103 | + if ( isGrailsApp ) |
| 104 | + { |
| 105 | + compile "org.grails.plugins:events" |
| 106 | + compile "org.grails.plugins:hibernate5" |
| 107 | + compile "org.hibernate:hibernate-core:${hibernateCoreV}" |
| 108 | + profile "org.grails.profiles:web" |
| 109 | + runtime "org.glassfish.web:el-impl:${elImplV}" |
| 110 | + runtime "com.h2database:h2" |
| 111 | + runtime "org.apache.tomcat:tomcat-jdbc" |
| 112 | + |
| 113 | + compile "de.codecentric:spring-boot-admin-starter-client:${springBootAdminStarterClientV}" |
| 114 | + compile "org.springframework.cloud:spring-cloud-starter-config" |
| 115 | + compile "org.springframework.cloud:spring-cloud-starter-eureka" |
| 116 | + } |
| 117 | + else if ( isGrailsPlugin ) |
| 118 | + { |
| 119 | + profile "org.grails.profiles:web-plugin" |
| 120 | + provided "org.grails:grails-plugin-services" |
| 121 | + provided "org.grails:grails-plugin-domain-class" |
| 122 | + testCompile "org.grails:grails-plugin-testing" |
| 123 | + } |
| 124 | + } |
| 125 | + |
| 126 | + bootRun { |
| 127 | + jvmArgs('-Dspring.output.ansi.enabled=always') |
| 128 | + addResources = true |
| 129 | + } |
| 130 | + |
| 131 | + if ( isGrailsPlugin ) |
| 132 | + { |
| 133 | + bootRepackage.enabled = false |
| 134 | + grailsPublish { |
| 135 | + // TODO: Provide values here |
| 136 | + user = 'user' |
| 137 | + key = 'key' |
| 138 | + githubSlug = 'foo/bar' |
| 139 | + license { |
| 140 | + name = 'Apache-2.0' |
| 141 | + } |
| 142 | + title = "My Plugin" |
| 143 | + desc = "Full plugin description" |
| 144 | + developers = [johndoe:"John Doe"] |
| 145 | + } |
| 146 | + } |
| 147 | + |
| 148 | + assets { |
| 149 | + if ( isGrailsApp ) |
| 150 | + { |
| 151 | + minifyJs = true |
| 152 | + minifyCss = true |
| 153 | + excludes = [ |
| 154 | + // "**/application.js", |
| 155 | + "**/i18n/**", |
| 156 | + "**/jquery*", |
| 157 | + "**/omar/**", |
| 158 | + "**/webjars/**", |
| 159 | + "**/*-debug.js", |
| 160 | + "**/*-deps.js", |
| 161 | + "**/*-openlayers*", |
| 162 | + "**/*.gz", |
| 163 | + "**/*.html", |
| 164 | + "**/*.txt", |
| 165 | + "**/*.es6" |
| 166 | + ] |
| 167 | + } |
| 168 | + else if ( isGrailsPlugin ) |
| 169 | + { |
| 170 | + packagePlugin = true |
| 171 | + } |
| 172 | + } |
| 173 | + } |
| 174 | +} |
0 commit comments