-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
98 lines (72 loc) · 2.54 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
86
87
88
89
90
91
92
93
94
95
96
97
98
def sourceFolder = file("$rootDir")
def templateProjectPath = file("../EcsProjectTemplate/ProjectFiles/Assets/Libs/")
//def exampleProjectPath = file("../StubbExample/StubbExample/Assets/Libs/")
def exampleProjectPath = file("../BubbleShooter/BubbleShooter/Assets/Libs/")
def frameworkFolderName = "Stubb"
def zipFilename = "${frameworkFolderName}.zip"
def buildDirName = "build"
task cleanTemplateProjectFolder(type: Delete) {
println "Clean folder $templateProjectPath"
delete "$templateProjectPath/$frameworkFolderName"
}
task cleanExampleProjectFolder(type: Delete) {
println "Clean folder $exampleProjectPath"
delete "$exampleProjectPath/$frameworkFolderName"
}
task copyToTemplate(type: Copy) {
println "Copy files from $buildDirName to $templateProjectPath"
from buildDirName
into templateProjectPath
include "$frameworkFolderName/"
}
task copyToExample(type: Copy) {
println "Copy files from $buildDirName to $exampleProjectPath"
from buildDirName
into exampleProjectPath
include "$frameworkFolderName/"
}
task collectSources(type: Copy) {
println "Filter and Copy source to the build folder!"
from sourceFolder
include 'ecs-unityintegration/'
include 'leoecs/'
include 'remotedebug/'
include 'ecs-ui/'
include 'StubbUnity/StubbUnity/Src/'
exclude '**/*.gradle'
exclude buildDirName
exclude '**/*.git'
if (!file(buildDirName).exists()) {
mkdir buildDirName
}
into "$buildDirName/$frameworkFolderName"
}
task createZip(type: Zip) {
println "Create ZIP file"
archiveFileName = zipFilename
destinationDirectory = file(sourceFolder)
from buildDirName
}
task cleanBuild(type: Delete) {
println "Cleanup build folder!"
def zipPath = "$sourceFolder/$zipFilename"
if (file(zipPath).exists()) {
delete zipPath
}
def buildDirPath = "$sourceFolder/$buildDirName/$frameworkFolderName"
if (file(buildDirPath).exists()) {
delete buildDirPath
}
}
task cleanAll(dependsOn: [cleanBuild, cleanTemplateProjectFolder, cleanExampleProjectFolder]) {
println "All projects are cleaned!"
}
task build(dependsOn: [cleanBuild, collectSources, createZip]) {
println "Stubb package has been created!"
}
task deployToTemplate(dependsOn: [cleanBuild, collectSources, cleanTemplateProjectFolder, copyToTemplate]) {
println "Deployed to the Template project!"
}
task deployToExample(dependsOn: [cleanBuild, collectSources, cleanExampleProjectFolder, copyToExample]) {
println "Deployed to the Example project!"
}