Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
dependencies {
classpath group: "com.gradle", name: "build-scan-plugin", version: "2.0.2"
classpath group: "com.liferay", name: "com.liferay.gradle.plugins.change.log.builder", version: "1.1.1"
classpath group: "com.liferay", name: "com.liferay.gradle.plugins.source.formatter", version: "2.3.479"
classpath group: "com.liferay", name: "com.liferay.gradle.plugins.source.formatter", version: "2.3.487"
classpath group: "nu.studer", name: "gradle-credentials-plugin", version: "2.1"
classpath group: "org.osgi", name: "osgi.core", version: "6.0.0"
}
Expand Down Expand Up @@ -92,6 +92,8 @@ dockerPublishSnapshots {

args.addAll(['-v', "${userHome}/.gradle/wrapper:/root/.gradle/wrapper"])

args.addAll(['-v', "${userHome}/.liferay/bundles:/root/.liferay/bundles"])

if (gradleCredentialsProperties.exists()) {
args.addAll(['-v', "${userHome}/.gradle/gradle.credentials.properties:/root/.gradle/gradle.encrypted.properties"])
}
Expand Down
11 changes: 11 additions & 0 deletions cli/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ Private-Package:\
com.liferay.gogo.shell.client,\
com.liferay.properties.locator,\
\
org.apache.tools.ant,\
org.apache.tools.ant.filters,\
org.apache.tools.ant.filters.util,\
org.apache.tools.ant.input,\
org.apache.tools.ant.property,\
org.apache.tools.ant.taskdefs,\
org.apache.tools.ant.taskdefs.condition,\
org.apache.tools.ant.types,\
org.apache.tools.ant.types.resources,\
org.apache.tools.ant.util,\
\
org.apache.commons.compress.archivers,\
org.apache.commons.compress.archivers.tar,\
org.apache.commons.compress.archivers.zip,\
Expand Down
3 changes: 2 additions & 1 deletion cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ dependencies {

compile group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "4.3.0"
compile group: "com.liferay", name: "com.liferay.gogo.shell.client", version: "1.0.0"
compile group: "com.liferay", name: "com.liferay.project.templates", version: "5.0.19"
compile group: "com.liferay", name: "com.liferay.project.templates", version: "5.0.21"
compile group: "commons-io", name: "commons-io", version: "2.6"
compile group: "org.apache.ant", name: "ant", version: "1.10.7"
compile group: "org.apache.commons", name: "commons-compress", version: "1.18"
compile group: "org.apache.commons", name: "commons-lang3", version: "3.4"
compile group: "org.apache.maven", name: "maven-aether-provider", version: "3.3.9"
Expand Down
48 changes: 15 additions & 33 deletions cli/src/main/java/com/liferay/blade/cli/BladeCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -513,44 +513,21 @@ else if (parameterMessage.contains("Main parameters are required")) {
}
}

public void runCommand() {
try {
if (_args.isHelp()) {
if (Objects.isNull(_command) || (_command.length() == 0)) {
printUsage();
}
else {
printUsage(_command);
}
public void runCommand() throws Exception {
if (_args.isHelp()) {
if (Objects.isNull(_command) || (_command.length() == 0)) {
printUsage();
}
else {
if (_args != null) {
_runCommand();
}
else {
_jCommander.usage();
}
printUsage(_command);
}
}
catch (ParameterException pe) {
throw pe;
}
catch (GradleExecutionException e) {
throw e;
}
catch (Exception e) {
Class<?> exceptionClass = e.getClass();

String exceptionClassName = exceptionClass.getName();

error("error: " + exceptionClassName + " :: " + e.getMessage() + System.lineSeparator());

if (_args.isTrace()) {
e.printStackTrace(error());
else {
if (_args != null) {
_runCommand();
}
else {
error("\tat " + e.getStackTrace()[0] + System.lineSeparator());
error("For more information run `blade " + _command + " --trace");
_jCommander.usage();
}
}
}
Expand Down Expand Up @@ -912,7 +889,12 @@ private String _getUpdateVersionIfAvailable(boolean snapshots) {

_out = System.out;

updateCommand.execute();
long timeout = 5000L;
long startTime = System.currentTimeMillis();

while (System.currentTimeMillis() - startTime < timeout) {
updateCommand.execute();
}
}
finally {
System.setOut(currentStdOut);
Expand Down
Loading