This repository has been archived by the owner on Feb 16, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
85 lines (75 loc) · 2.4 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
plugins {
id "mpern.sap.commerce.build" version "1.2.0"
}
import mpern.sap.commerce.build.tasks.HybrisAntTask
import java.nio.file.Files
hybris {
version = '6.7.0.8'
}
repositories {
jcenter()
flatDir {
dirs "${rootProject.projectDir}/libs"
}
}
configurations {
hotswapagent
}
dependencies {
hotswapagent('org.hotswapagent:hotswap-agent:1.3.0') {
transitive = false
}
}
task downloadHotSwapAgent(type: Copy) {
from configurations.hotswapagent
into file("hybris/config")
}
//to avoid checking in the generated module, create it on demand:
task disableLocalExtensions {
doLast {
Files.move(file("hybris/config/localextensions.xml").toPath(), file("hybris/config/localextensions.xml.off").toPath())
}
}
task setupStorefront(type: HybrisAntTask, dependsOn: ["disableLocalExtensions"]) {
onlyIf {
!file("hybris/bin/custom/demo").exists()
}
args("modulegen")
antProperty("input.module", "accelerator")
antProperty("input.name", "demo")
antProperty("input.package", "com.demo")
}
setupStorefront.mustRunAfter "bootstrapPlatform"
task enableLocalExtensions {
doLast {
if (file("hybris/config/localextensions.xml.off").exists()) {
Files.move(file("hybris/config/localextensions.xml.off").toPath(), file("hybris/config/localextensions.xml").toPath())
}
}
}
task installCowAddon(type: HybrisAntTask, dependsOn: ["enableLocalExtensions"]) {
args("addoninstall")
antProperty("addonnames", "cowaddon")
antProperty("addonStorefront.yacceleratorstorefront", "demostorefront")
}
installCowAddon.mustRunAfter setupStorefront
task bootstrap(dependsOn: ["bootstrapPlatform", "setupStorefront", "installCowAddon"]) {
group "Project"
description "Bootstrap this project"
}
task unitTests(type: HybrisAntTask) {
args("unittests")
antProperty("testclasses.extensions", "cowsaytests")
antProperty("testclasses.suppress.junit.tenant", "true")
}
//make sure the junit tenant is properly initialized before running the integration tests
//ant yunitinit -Dde.hybris.platform.ant.production.skip.build=true
task integrationtests(type: HybrisAntTask) {
args("integrationtests")
antProperty("testclasses.extensions", "cowsaytests")
}
task storefronttests(type: HybrisAntTask) {
args("alltests")
antProperty("testclasses.web", "true")
antProperty("testclasses.extensions", "demostorefront")
}