summaryrefslogtreecommitdiffstats
path: root/buildhelpers
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2016-09-18 17:38:12 +0300
committerLeif Åstrand <leif@vaadin.com>2016-09-20 06:07:31 +0000
commitc5c52684eb30d924cb75a632b526a0f879d5a33c (patch)
tree7025aff24585c55161a513102dedfc1a55c751bd /buildhelpers
parent57a965251afdb5ee9ac1913a0101d854d8215aa6 (diff)
downloadvaadin-framework-c5c52684eb30d924cb75a632b526a0f879d5a33c.tar.gz
vaadin-framework-c5c52684eb30d924cb75a632b526a0f879d5a33c.zip
Format Java files using Eclipse Neon and Vaadin settings
Using the same formatting in the 7.7 branch and the master branch eases porting of fixes Change-Id: I51b4693f2f120447702cf322ce4505608ad92987
Diffstat (limited to 'buildhelpers')
-rw-r--r--buildhelpers/src/main/java/com/vaadin/buildhelpers/CompileTheme.java30
-rw-r--r--buildhelpers/src/main/java/com/vaadin/buildhelpers/GeneratePackageExports.java29
-rw-r--r--buildhelpers/src/main/java/com/vaadin/buildhelpers/ManifestWriter.java36
3 files changed, 48 insertions, 47 deletions
diff --git a/buildhelpers/src/main/java/com/vaadin/buildhelpers/CompileTheme.java b/buildhelpers/src/main/java/com/vaadin/buildhelpers/CompileTheme.java
index d97025bdb6..edd4fd9b88 100644
--- a/buildhelpers/src/main/java/com/vaadin/buildhelpers/CompileTheme.java
+++ b/buildhelpers/src/main/java/com/vaadin/buildhelpers/CompileTheme.java
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2014 Vaadin Ltd.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -64,11 +64,11 @@ public class CompileTheme {
// Regular theme
try {
processSassTheme(themeFolder, themeName, "styles", version);
- System.out.println("Compiling theme " + themeName
- + " styles successful");
+ System.out.println(
+ "Compiling theme " + themeName + " styles successful");
} catch (Exception e) {
- System.err.println("Compiling theme " + themeName
- + " styles failed");
+ System.err
+ .println("Compiling theme " + themeName + " styles failed");
e.printStackTrace();
}
// Legacy theme w/o .themename{} wrapping
@@ -82,8 +82,8 @@ public class CompileTheme {
+ " legacy-styles successful");
}
} catch (Exception e) {
- System.err.println("Compiling theme " + themeName
- + " legacy-styles failed");
+ System.err.println(
+ "Compiling theme " + themeName + " legacy-styles failed");
e.printStackTrace();
}
}
@@ -103,8 +103,8 @@ public class CompileTheme {
ScssStylesheet scss = ScssStylesheet.get(sassFile);
if (scss == null) {
- throw new IllegalArgumentException("SASS file: " + sassFile
- + " not found");
+ throw new IllegalArgumentException(
+ "SASS file: " + sassFile + " not found");
}
scss.compile();
String filteredScss = scss.printState().replace("@version@", version);
@@ -128,8 +128,8 @@ public class CompileTheme {
boolean ok = newCss.renameTo(oldCss);
if (!ok) {
- throw new RuntimeException("Rename " + newCss + " -> " + oldCss
- + " failed");
+ throw new RuntimeException(
+ "Rename " + newCss + " -> " + oldCss + " failed");
}
}
@@ -142,8 +142,8 @@ public class CompileTheme {
// hiding other classpath issues
Class<?> smartSpritesClass = org.carrot2.labs.smartsprites.SmartSprites.class;
} catch (NoClassDefFoundError e) {
- System.err
- .println("Could not find smartsprites. No sprites were generated. The theme should still work.");
+ System.err.println(
+ "Could not find smartsprites. No sprites were generated. The theme should still work.");
return;
}
diff --git a/buildhelpers/src/main/java/com/vaadin/buildhelpers/GeneratePackageExports.java b/buildhelpers/src/main/java/com/vaadin/buildhelpers/GeneratePackageExports.java
index d4ad3f838c..a27bed1dba 100644
--- a/buildhelpers/src/main/java/com/vaadin/buildhelpers/GeneratePackageExports.java
+++ b/buildhelpers/src/main/java/com/vaadin/buildhelpers/GeneratePackageExports.java
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2014 Vaadin Ltd.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -35,7 +35,7 @@ import java.util.regex.Pattern;
* Export-Package attribute, and appends it to the jar's MANIFEST.MF.
* <p>
* See #3521 for details.
- *
+ *
* @author magi
*/
public class GeneratePackageExports {
@@ -44,11 +44,10 @@ public class GeneratePackageExports {
public static void main(String[] args) {
if (args.length < 2) {
- System.err
- .println("Invalid number of parameters\n"
- + "Usage: java -cp .. GenerateManifest <package.jar> <accepted package prefixes>\n"
- + "Use -Dvaadin.version to specify the version to be used for the packages\n"
- + "Use -DincludeNumberPackages=1 to include package names which start with a number (not 100% OSGi compatible)");
+ System.err.println("Invalid number of parameters\n"
+ + "Usage: java -cp .. GenerateManifest <package.jar> <accepted package prefixes>\n"
+ + "Use -Dvaadin.version to specify the version to be used for the packages\n"
+ + "Use -DincludeNumberPackages=1 to include package names which start with a number (not 100% OSGi compatible)");
System.exit(1);
}
@@ -149,7 +148,7 @@ public class GeneratePackageExports {
* version.<java package>. Searches for the packge and then its parents
* recursively. Falls back to the "vaadin.version" system property if no
* other properties are found.
- *
+ *
* @param javaPackage
* The package to determine a version for
* @return A version or null if no version has been defined
@@ -178,7 +177,8 @@ public class GeneratePackageExports {
}
private static HashSet<String> getPackages(JarFile jar,
- List<String> acceptedPackagePrefixes, boolean includeNumberPackages) {
+ List<String> acceptedPackagePrefixes,
+ boolean includeNumberPackages) {
HashSet<String> packages = new HashSet<String>();
Pattern startsWithNumber = Pattern.compile("\\.\\d");
@@ -198,10 +198,11 @@ public class GeneratePackageExports {
}
int lastSlash = entry.getName().lastIndexOf('/');
- String pkg = entry.getName().substring(0, lastSlash)
- .replace('/', '.');
+ String pkg = entry.getName().substring(0, lastSlash).replace('/',
+ '.');
- if (!includeNumberPackages && startsWithNumber.matcher(pkg).find()) {
+ if (!includeNumberPackages
+ && startsWithNumber.matcher(pkg).find()) {
continue;
}
diff --git a/buildhelpers/src/main/java/com/vaadin/buildhelpers/ManifestWriter.java b/buildhelpers/src/main/java/com/vaadin/buildhelpers/ManifestWriter.java
index 9e9b29c4a1..bb8cb27e38 100644
--- a/buildhelpers/src/main/java/com/vaadin/buildhelpers/ManifestWriter.java
+++ b/buildhelpers/src/main/java/com/vaadin/buildhelpers/ManifestWriter.java
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2014 Vaadin Ltd.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -33,7 +33,7 @@ public class ManifestWriter {
/**
* Writes a manifest attribute to a temporary buffer.
- *
+ *
* @param name
* Attribute name
* @param value
@@ -56,10 +56,10 @@ public class ManifestWriter {
/**
* Writes the manifest to given JAR file.
- *
+ *
* The manifest must be created with {@code #writeAttribute(String, String)}
* before calling this write.
- *
+ *
* @param jarFilename
* File name of the JAR in which the manifest is written
* @return 0 on success, nonzero value on error
@@ -85,9 +85,9 @@ public class ManifestWriter {
fos.write(getBytes());
fos.close();
} catch (IOException e) {
- System.err.println("Writing to file '"
- + newMfFile.getAbsolutePath() + "' failed because: "
- + e.getMessage());
+ System.err.println(
+ "Writing to file '" + newMfFile.getAbsolutePath()
+ + "' failed because: " + e.getMessage());
status = 1;
}
}
@@ -100,9 +100,9 @@ public class ManifestWriter {
is = new FileInputStream(newMfFile);
checkMf.read(is);
} catch (IOException e) {
- System.err.println("Reading from file '"
- + newMfFile.getAbsolutePath() + "' failed because: "
- + e.getMessage());
+ System.err.println(
+ "Reading from file '" + newMfFile.getAbsolutePath()
+ + "' failed because: " + e.getMessage());
status = 1;
}
}
@@ -112,8 +112,8 @@ public class ManifestWriter {
System.out.println("Updating manifest in JAR " + jarFilename);
try {
// The "mf" order must correspond with manifest-jarfile order
- Process process = Runtime.getRuntime().exec(
- new String[] { "jar", "umf",
+ Process process = Runtime.getRuntime()
+ .exec(new String[] { "jar", "umf",
newMfFile.getAbsolutePath(), jarFilename });
int exitValue = process.waitFor();
if (exitValue != 0) {
@@ -123,14 +123,14 @@ public class ManifestWriter {
while (reader.ready()) {
System.err.println("jar: " + reader.readLine());
}
- System.err
- .println("The 'jar' command returned with exit value "
+ System.err.println(
+ "The 'jar' command returned with exit value "
+ exitValue);
status = 1;
}
} catch (IOException e) {
- System.err.println("Failed to execute 'jar' command. "
- + e.getMessage());
+ System.err.println(
+ "Failed to execute 'jar' command. " + e.getMessage());
status = 1;
} catch (InterruptedException e) {
System.err