Skip to content

Commit 81226f1

Browse files
authored
fix issues build.gradle profiles (#390)
1 parent c56658e commit 81226f1

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

server/build.gradle

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def setFlywayDev(dbScripts) {
165165
}
166166

167167
def isDevProfile(String profile) {
168-
return profile == null || profile.equalsIgnoreCase("integration") || profiles.equalsIgnoreCase("dev");
168+
profile in ["integration", "dev", "test", "local"]
169169
}
170170

171171
def addDevScriptsToMigrations(dbScripts) {
@@ -175,9 +175,23 @@ def addDevScriptsToMigrations(dbScripts) {
175175

176176
def setFlywayPrefrences(profiles, dbScripts) {
177177
if(profiles != null) {
178+
def ListOfProfiles = []
178179
boolean isList = profiles instanceof List;
180+
boolean isStr = profiles instanceof String;
181+
182+
if(isList) {
183+
ListOfProfiles = profiles
184+
}
185+
186+
// string of profiles delimated by a comma.
187+
if(isStr) {
188+
ListOfProfiles = profiles.split(',');
189+
isList = ListOfProfiles.size() > 1;
190+
}
191+
179192
if (isList) {
180-
for(String prof in profiles) {
193+
for(String prof in ListOfProfiles) {
194+
println(prof)
181195
if(isDevProfile(prof)) {
182196
setFlywayDev(dbScripts);
183197
break;

0 commit comments

Comments
 (0)