Skip to content

Commit a22f4ee

Browse files
authored
Merge pull request #5 from ossimlabs/OP-5
restructured project to have a top level build.gradle
2 parents 8500139 + e56f041 commit a22f4ee

File tree

4 files changed

+182
-85
lines changed

4 files changed

+182
-85
lines changed

build.gradle

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
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+
}

gradle.properties

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
buildVersion=1.2.2
1+
grailsVersion=3.3.2
2+
gradleWrapperVersion=4.10.3
3+
gormVersion=6.1.8.RELEASE
4+
5+
buildVersion=1.2.3
26

37
ossimMavenProxy=https://nexus.ossim.io/repository/all-repos
48

59
mavenRepoUrl=https://nexus.ossim.io/repository
610
mavenRepoUsername=
711
mavenRepoPassword=
812
jarDestination=
13+
14+
assetPipelineGradleV=2.14.10
15+
gradleDefaultsV=1.8-SNAPSHOT
Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,3 @@
1-
buildscript {
2-
repositories {
3-
mavenLocal()
4-
maven { url ossimMavenProxy }
5-
}
6-
dependencies {
7-
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
8-
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.10"
9-
classpath 'io.ossim:gradleDefaults:1.7-SNAPSHOT'
10-
}
11-
}
12-
13-
/*
14-
plugins {
15-
id "com.github.ben-manes.versions" version "0.17.0"
16-
id "org.sonarqube" version "2.6.2"
17-
}
18-
*/
19-
20-
apply plugin: "eclipse"
21-
apply plugin: "idea"
22-
apply plugin: "org.grails.grails-plugin"
23-
apply plugin: "org.grails.grails-plugin-publish"
24-
apply plugin: "org.grails.grails-gsp"
25-
apply plugin: "asset-pipeline"
26-
27-
apply plugin: "java"
28-
apply plugin: "maven-publish"
29-
30-
repositories {
31-
mavenLocal()
32-
maven { url ossimMavenProxy }
33-
}
34-
35-
sourceSets.main.output.classesDir = 'build/classes/groovy/main'
36-
io.ossim.gradleDefaults.Variables.setAdditionalVariables(project)
37-
io.ossim.gradleDefaults.Variables.setVersionVariables(project)
38-
version "${buildVersion}-${buildVersionTag}"
39-
jarDestination = "${projectDir}/build/libs/${project.name}-${version}.jar"
40-
io.ossim.gradleDefaults.Publications.addPublication(project, groupName, name, "${buildVersion}-${buildVersionTag}")
41-
io.ossim.gradleDefaults.Publications.addRepository(project, mavenPublishUrl, mavenRepoUsername, mavenRepoPassword)
42-
431
dependencies {
44-
452
compile "org.hibernate:hibernate-spatial:${hibernateSpatialV}"
46-
47-
compile "org.springframework.boot:spring-boot-starter-logging"
48-
compile "org.springframework.boot:spring-boot-autoconfigure"
49-
compile "org.grails:grails-core"
50-
compile "org.springframework.boot:spring-boot-starter-actuator"
51-
compile "org.springframework.boot:spring-boot-starter-tomcat"
52-
compile "org.grails:grails-web-boot"
53-
compile "org.grails:grails-logging"
54-
compile "org.grails:grails-plugin-rest"
55-
compile "org.grails:grails-plugin-databinding"
56-
compile "org.grails:grails-plugin-i18n"
57-
compile "org.grails:grails-plugin-services"
58-
compile "org.grails:grails-plugin-url-mappings"
59-
compile "org.grails:grails-plugin-interceptors"
60-
compile "org.grails.plugins:cache"
61-
compile "org.grails.plugins:async"
62-
compile "org.grails.plugins:scaffolding"
63-
compile "org.grails.plugins:gsp"
64-
console "org.grails:grails-console"
65-
profile "org.grails.profiles:web-plugin"
66-
provided "org.grails:grails-plugin-services"
67-
provided "org.grails:grails-plugin-domain-class"
68-
runtime "com.bertramlabs.plugins:asset-pipeline-grails:${assetPipelineGrailsV}"
69-
testCompile "org.grails:grails-gorm-testing-support"
70-
testCompile "org.grails:grails-plugin-testing"
71-
testCompile "org.grails.plugins:geb"
72-
testCompile "org.grails:grails-web-testing-support"
73-
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:${seleniumHtmlUnitDriverV}"
74-
testRuntime "net.sourceforge.htmlunit:htmlunit:${htmlUnitV}"
75-
76-
}
77-
78-
bootRepackage.enabled = false
79-
80-
assets {
81-
packagePlugin = true
823
}
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
grailsVersion=3.3.2
2-
gradleWrapperVersion=3.5
3-
gormVersion=6.1.8.RELEASE
4-
lastCommit=2ebdad4
5-
61
groupName=io.ossim.omar.plugins

0 commit comments

Comments
 (0)