Skip to content

Commit 87a2cba

Browse files
committed
#9 refactoring
1 parent 5e8c219 commit 87a2cba

2 files changed

Lines changed: 3 additions & 40 deletions

File tree

build.gradle

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ buildscript {
99
password(rootProject.hasProperty('repoPass') ? rootProject['repoPass'] : 'cuba123')
1010
}
1111
}
12-
13-
14-
1512
}
13+
1614
dependencies {
1715
classpath "com.haulmont.gradle:cuba-plugin:$cubaVersion"
1816
// Bintray upload plugin
@@ -32,8 +30,6 @@ def servletApi = 'javax.servlet:javax.servlet-api:3.1.0'
3230
apply(plugin: 'idea')
3331
apply(plugin: 'cuba')
3432

35-
def bintrayRepositoryUrl = "https://api.bintray.com/maven/balvi/cuba-components/cuba-component-declarative-controllers/;publish=1"
36-
3733
cuba {
3834
artifact {
3935
group = 'de.balvi.cuba.declarativecontrollers'
@@ -43,16 +39,6 @@ cuba {
4339
tomcat {
4440
dir = "$project.rootDir/deploy/tomcat"
4541
}
46-
uploadRepository {
47-
if (cuba.artifact.isSnapshot) {
48-
url = System.properties['uploadRepositorySnapshot'] ?: System.env.UPLOAD_REPOSITORY_SNAPSHOT
49-
} else {
50-
url = System.properties['uploadRepositoryRelease'] ?: System.env.UPLOAD_REPOSITORY_RELEASE ?: bintrayRepositoryUrl
51-
}
52-
53-
user = System.properties['uploadRepositoryUsername'] ?: System.env.UPLOAD_REPOSITORY_USERNAME
54-
password = System.properties['uploadRepositoryPassword'] ?:System.env.UPLOAD_REPOSITORY_PASSWORD
55-
}
5642
ide {
5743
vcs = 'Git'
5844
}
@@ -90,12 +76,10 @@ cobertura {
9076

9177
}
9278

93-
9479
test.dependsOn(subprojects.collect{ ":${it.name}:test"} )
9580
test.finalizedBy(project.tasks.cobertura)
9681
test.finalizedBy(project.tasks.coberturaCheck)
9782

98-
9983
configure([globalModule, coreModule, guiModule, webModule]) {
10084
apply(plugin: 'java')
10185
apply(plugin: 'maven')
@@ -104,7 +88,6 @@ configure([globalModule, coreModule, guiModule, webModule]) {
10488

10589
dependencies {
10690
testCompile('junit:junit:4.12')
107-
10891
testCompile('org.spockframework:spock-core:1.0-groovy-2.4')
10992
testCompile('org.springframework:spring-test:4.3.1.RELEASE')
11093
testRuntime "cglib:cglib-nodep:3.2.4"
@@ -170,8 +153,6 @@ configure(globalModule) {
170153
attributes('App-Component-Version': cuba.artifact.version + (cuba.artifact.isSnapshot ? '-SNAPSHOT' : ''))
171154
}
172155
}
173-
174-
175156
}
176157

177158
configure(coreModule) {
@@ -225,7 +206,6 @@ configure(coreModule) {
225206
configure(guiModule) {
226207
dependencies {
227208
compile(globalModule)
228-
229209
}
230210

231211
task deployConf(type: Copy) {
@@ -243,7 +223,6 @@ configure(webModule) {
243223
dependencies {
244224
provided(servletApi)
245225
compile(guiModule)
246-
247226
}
248227

249228
task webArchive(type: Zip) {
@@ -265,6 +244,7 @@ configure(webModule) {
265244
task clearMessagesCache(type: CubaClearMessagesCache) {
266245
appName = 'declarativecontrollers'
267246
}
247+
268248
deployConf.dependsOn clearMessagesCache
269249

270250
task cleanConf(description: 'Cleans up conf directory') {
@@ -284,10 +264,6 @@ configure(webModule) {
284264
}
285265
}
286266

287-
288-
289-
290-
291267
task undeploy(type: Delete, dependsOn: ':declarativecontrollers-web:cleanConf') {
292268
delete("$cuba.tomcat.dir/shared")
293269
delete("$cuba.tomcat.dir/webapps/declarativecontrollers-core")

upload-to-repository.sh

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
11
#!/usr/bin/env bash
22

3-
if [[ -z "$1" || -z "$2" ]]
4-
then
5-
echo "Define username, password and repository URL as parameters. Usage: ./upload-to-repository.sh myUser myPassword https://api.bintray.com/maven/balvi/..."
6-
7-
else
8-
if [[ -z "$3" ]]
9-
then
10-
./gradlew -DuploadRepositoryUsername=$1 -DuploadRepositoryPassword=$2 uploadArchives
11-
else
12-
./gradlew -DuploadRepositoryUsername=$1 -DuploadRepositoryPassword=$2 -DuploadRepositoryRelease=$3 uploadArchives
13-
14-
fi
15-
16-
fi
3+
./gradlew clean assemble bintrayUpload

0 commit comments

Comments
 (0)