build scripts: change remote dir name on Mac OS machine to avoid conflicts

It may happen that several builds with the same number are started simultaneously. Also theoretically builds may start in the same second.

(cherry picked from commit eda3c91, IDEA-CR-16653)
This commit is contained in:
Mikhail Filippov
2016-12-12 11:51:31 +03:00
committed by nik
parent c3e2e504bd
commit 7fc4ed9c22
@@ -65,10 +65,10 @@ class MacDmgBuilder {
private static MacDmgBuilder createInstance(BuildContext buildContext, MacDistributionCustomizer customizer, MacHostProperties macHostProperties) {
defineTasks(buildContext.ant, "${buildContext.paths.communityHome}/lib")
String remoteDir = "intellij-builds/${buildContext.fullBuildNumber}"
if (remoteDir.toLowerCase().endsWith("snapshot")) {
remoteDir += "-" + LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME).replace(':', '-')
}
String currentDateTimeString = LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME).replace(':', '-')
int randomSeed = new Random().nextInt(Integer.MAX_VALUE)
String remoteDir = "intellij-builds/${buildContext.fullBuildNumber}-${currentDateTimeString}-${randomSeed}"
new MacDmgBuilder(buildContext, customizer, remoteDir, macHostProperties)
}