Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plovr now works end-to-end: can start up the executable jar with one …
…or more config files
- Loading branch information
Showing
11 changed files
with
300 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Creating a separate script to list files in a directory is much easier than | ||
# trying to accomplish the equivalent thing in pure Ant. | ||
|
||
# Change to the directory to eliminate any relative directory prefix. | ||
cd $1 | ||
|
||
# Remove the "./" from the beginning of each entry, and exclude deps.js files. | ||
find . -name '*.js' | grep -v deps.js | cut -b 3- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.plovr; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.InputStreamReader; | ||
import java.util.logging.Logger; | ||
|
||
import com.google.common.io.LineReader; | ||
|
||
/** | ||
* {@link ResourceJsInput} represents a JavaScript file loaded from a JAR, so | ||
* it will never change, so its dependencies must only be read once. | ||
* | ||
* @author bolinfest@gmail.com (Michael Bolin) | ||
*/ | ||
class ResourceJsInput extends AbstractJsInput { | ||
|
||
private static final Logger logger = Logger.getLogger("org.plovr.ResourceJsInput"); | ||
|
||
private final String pathToResource; | ||
|
||
ResourceJsInput(String pathToResource) { | ||
super(pathToResource); | ||
this.pathToResource = pathToResource; | ||
} | ||
|
||
@Override | ||
public String getCode() { | ||
try { | ||
InputStream input = ResourceReader.class.getResourceAsStream( | ||
pathToResource); | ||
Readable readable = new InputStreamReader(input); | ||
LineReader lineReader = new LineReader(readable); | ||
StringBuilder builder = new StringBuilder(); | ||
String line; | ||
while ((line = lineReader.readLine()) != null) { | ||
builder.append(line + "\n"); | ||
} | ||
return builder.toString(); | ||
} catch (IOException e) { | ||
logger.severe(e.getMessage()); | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.