forked from akasiri/mantle-stripe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
64 lines (48 loc) · 1.88 KB
/
build.gradle
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
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'groovy'
buildscript {
repositories {
mavenCentral()
}
}
sourceCompatibility = '1.8'
def jarBaseName = 'CompiledComponentName' // Customize compiled file name
def componentNode = parseComponent(project)
def moquiDir = file(projectDir.absolutePath + '/../../..')
def frameworkDir = file(moquiDir.absolutePath + '/framework')
test {
dependsOn cleanTest
systemProperty 'moqui.runtime', moquiDir.absolutePath + '/runtime'
systemProperty 'moqui.conf', 'conf/MoquiDevConf.xml'
systemProperty 'moqui.init.static', 'true'
// testLogging.showsStandardStreams = true; testLogging.showExceptions = true
classpath += files(sourceSets.main.output.classesDirs)
classpath = classpath.filter { it.exists() }
beforeTest { descriptor -> logger.lifecycle("Runnin test: ${descriptor}") }
}
version = componentNode.'@version'
repositories {
flatDir name: 'localLib', dirs: frameworkDir.absolutePath + '/lib'
jcenter()
mavenCentral()
}
tasks.withType(JavaCompile) { options.compilerArgs << "-proc:none" }
tasks.withType(GroovyCompile) { options.compilerArgs << "-proc:none" }
dependencies {
compile project(':framework')
testCompile project(':framework').configurations.testCompile.allDependencies
compile "com.stripe:stripe-java:7.1.0"
}
task cleanLib(type: Delete) { delete fileTree(dir: projectDir.absolutePath+'/lib', include: '*') }
clean.dependsOn cleanLib
jar {
destinationDir = file(projectDir.absolutePath + '/lib') // Declaring compiled Groovy goes into lib directory
baseName = jarBaseName
}
task copyDependencies { doLast {
copy { from (configurations.runtime - project(':framework').configurations.runtime - project(':framework').jar.archivePath)
into file(projectDir.absolutePath + '/lib') }
} }
copyDependencies.dependsOn cleanLib
jar.dependsOn copyDependencies