This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Jenkinsfile
161 lines (139 loc) · 4.01 KB
/
Jenkinsfile
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/*
* Foleys Finest Jenkinsfile
*
* Build server setup:
*
* Pipeline Project
* - Pipeline script from SCM
* - Advanced clone Behaviours
* - Fetch tags
* - Shallow clone (depth 1)
* - Advanced sub-modules behaviours
* - Recursively update submodules
* - Use credentials from default remote of parent repository
* - Clean before checkout
*
* Environment Variables
* - BUILD_SERVER_PLATFORM (mac|windows)
* - KEYCHAIN_PASSWORD (backquote $)
*
* Mac only
* - APP_SIGNATURE (8FRDEFHGAV)
*
* Windows only
* - MSBUILD (C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe)
* - ZIP_EXE (C:\Program Files\7-Zip\7z.exe)
* - INNO_SETUP_EXE (C:\Program Files (x86)\Inno Setup 5\ISCC.exe)
*/
def MSBUILD = env.MSBUILD
def ZIP_EXE = env.ZIP_EXE
node
{
stage('Checkout')
{
checkout scm
}
stage('Projucer')
{
buildProjucer()
}
stage('APVTS_Tutorial')
{
buildPlugin ("APVTS_Tutorial", "")
}
stage('SignalGenerator')
{
buildPlugin ("SignalGenerator", "")
}
stage('ExtendingExample')
{
buildPlugin ("ExtendingExample", "")
}
stage('EqualizerExample')
{
buildPlugin ("EqualizerExample", "")
}
stage('FoleysSynth')
{
buildPlugin ("FoleysSynth", "")
}
stage('PlayerExample')
{
buildPlugin ("PlayerExample", "")
}
}
void makeOutputDirectory(String platform)
{
if (platform == 'mac')
sh "mkdir output"
else if (platform == 'windows')
bat "md output"
}
void buildProjucer()
{
if (env.BUILD_SERVER_PLATFORM == 'mac')
{
sh """
cd JUCE/extras/Projucer
xcodebuild -configuration Release -project Builds/MacOSX/Projucer.xcodeproj
"""
}
else if (env.BUILD_SERVER_PLATFORM == 'windows')
{
bat """
cd "JUCE\\extras\\Projucer"
"${env.MSBUILD2017}" /p:Configuration=Release Builds\\VisualStudio2017\\Projucer.sln
"""
}
}
void createProject(String project)
{
def PROJUCER_BIN = "JUCE/extras/Projucer/Builds/MacOSX/build/Release/Projucer.app/Contents/MacOS/Projucer"
def PROJUCER_EXE = "JUCE\\extras\\Projucer\\Builds\\VisualStudio2017\\x64\\Release\\App\\Projucer.exe"
if (env.BUILD_SERVER_PLATFORM == 'mac')
sh "${PROJUCER_BIN} --resave ${project}.jucer"
else if (env.BUILD_SERVER_PLATFORM == 'windows')
bat "${PROJUCER_EXE} --resave ${project}.jucer"
}
void buildProject(String folder, String project, String configuration)
{
if (env.BUILD_SERVER_PLATFORM == 'mac')
{
sh """
cd ${folder}
xcodebuild -configuration ${configuration} -project Builds/MacOSX/${project}.xcodeproj
"""
}
else if (env.BUILD_SERVER_PLATFORM == 'windows')
{
bat """
cd "${folder}"
"${env.MSBUILD2019}" /p:Configuration=${configuration} Builds\\VisualStudio2019\\${project}.sln
"""
}
}
def buildPlugin (String pluginName, String iLokID)
{
def PROJUCER_BIN = "JUCE/extras/Projucer/Builds/MacOSX/build/Release/Projucer.app/Contents/MacOS/Projucer"
def PROJUCER_EXE = "JUCE\\extras\\Projucer\\Builds\\VisualStudio2017\\x64\\Release\\App\\Projucer.exe"
try
{
if (env.BUILD_SERVER_PLATFORM == 'mac')
{
sh "${PROJUCER_BIN} --resave examples/${pluginName}/${pluginName}.jucer"
def VERSION=sh script: "${PROJUCER_BIN} --get-version examples/${pluginName}/${pluginName}.jucer", returnStdout: true
sh "xcodebuild -configuration Release -project examples/${pluginName}/Builds/MacOSX/${pluginName}.xcodeproj"
}
else if (env.BUILD_SERVER_PLATFORM == 'windows')
{
bat "${PROJUCER_EXE} --resave examples\\${pluginName}\\${pluginName}.jucer"
bat """
"${env.MSBUILD2019}" /p:Configuration=Release examples\\${pluginName}\\Builds\\VisualStudio2019\\${pluginName}.sln
"""
}
}
catch (error)
{
throw error
}
}