Skip to content

Commit

Permalink
CLC improvement.
Browse files Browse the repository at this point in the history
Don't fail on locked file... but show warning instead.
  • Loading branch information
zapov committed Jan 23, 2017
1 parent 240cd35 commit 4dd1941
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CommandLineClient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.dslplatform</groupId>
<artifactId>dsl-clc</artifactId>
<packaging>jar</packaging>
<version>1.8.5</version>
<version>1.8.6</version>
<name>DSL Platform - Compiler Command-Line Client</name>
<url>https://github.com/ngs-doo/dsl-compiler-client</url>
<description>Command line client for interaction with DSL Platform compiler (https://dsl-platform.com)</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ public boolean check(final Context context) throws ExitException {
} else throw new ExitException();
}
context.show("Downloading DSL Platform compiler since it's not found in: " + compiler.getAbsolutePath());
downloadCompiler(context, path, tempPath, compiler);
downloadCompiler(context, path, tempPath, compiler, true);
} else {
if (!testCompiler(context, path)) {
context.error("Specified compiler is invalid: " + path.getAbsolutePath());
Expand All @@ -646,23 +646,30 @@ public static void checkForLatestVersion(Context context, File path, File tempPa
if (!lastModified.isSuccess()) {
context.warning(lastModified.whyNot());
} else if (compiler.lastModified() != lastModified.get()) {
downloadCompiler(context, path, tempPath, compiler);
downloadCompiler(context, path, tempPath, compiler, false);
}
}

private static void downloadCompiler(
final Context context,
final File path,
final File tempPath,
final File compiler) throws ExitException {
final File compiler,
final boolean failOnError) throws ExitException {
final long lastModified;
try {
lastModified = Utils.downloadAndUnpack(context, "dsl-compiler", tempPath);
} catch (final IOException ex) {
context.error("Error downloading compiler from https://dsl-platform.com");
context.error("Try specifying alternative compiler location.");
context.error(ex);
throw new ExitException();
if (failOnError) {
context.error("Error downloading compiler from https://dsl-platform.com");
context.error("Try specifying alternative compiler location.");
context.error(ex);
throw new ExitException();
} else {
context.warning("Error downloading compiler from https://dsl-platform.com");
context.warning("Skipping...");
return;
}
}
if (!testCompiler(context, compiler)) {
context.error("Specified compiler is invalid: " + path.getAbsolutePath());
Expand Down
4 changes: 2 additions & 2 deletions MavenPlugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.dslplatform</groupId>
<artifactId>dsl-platform-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
<version>1.1.1</version>
<version>1.1.2</version>
<name>DSL Platform - Maven plugin</name>
<url>https://github.com/ngs-doo/dsl-compiler-client</url>
<description>A Maven plugin for interaction with DSL Platform command line client API (https://dsl-platform.com)</description>
Expand Down Expand Up @@ -63,7 +63,7 @@
<dependency>
<groupId>com.dslplatform</groupId>
<artifactId>dsl-clc</artifactId>
<version>1.8.5</version>
<version>1.8.6</version>
</dependency>

<dependency>
Expand Down

0 comments on commit 4dd1941

Please sign in to comment.