Permalink
Browse files

[jmdb] About to add ability to choose tasks

  • Loading branch information...
1 parent 41ab175 commit e6661bafda6ace8ad7ad77e7c2dd6f4cf458ee9a @jimbarritt jimbarritt committed Jun 8, 2012
View
@@ -0,0 +1 @@
+module.name=platform-build
@@ -26,7 +26,7 @@
private final RelativeFile targetJarfile;
private final RelativeFile targetLibDir;
private final String moduleName;
- private final Map<String, Object> moduleConfiguration;
+ private final Map<String, String> moduleConfiguration;
public static void main(String[] args) {
@@ -57,13 +57,14 @@ public ModuleBuilder(BuildLog consoleLog, File moduleDir) {
buildLog.printTitle("Builder (v.10) - building now!");
}
- private Map<String, Object> loadModuleConfiguration(File moduleDir) {
+ private Map<String, String> loadModuleConfiguration(File moduleDir) {
File configFile = new File(moduleDir.getAbsolutePath() + "/module.ibx");
if (!configFile.exists()) {
- return new HashMap<String, Object>();
+ return new HashMap<String, String>();
}
+ buildLog.println("Loading configuration from [%s]", configFile.getAbsolutePath());
Properties p = new Properties();
Reader in = null;
@@ -72,14 +73,18 @@ public ModuleBuilder(BuildLog consoleLog, File moduleDir) {
in = new BufferedReader(new FileReader(configFile));
p.load(in);
+
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
tryToClose(in);
}
- Map<String, Object> output = new HashMap<String, Object>();
- p.putAll(output);
+ Map<String, String> output = new HashMap<String, String>();
+ for (Object key : p.keySet()) {
+ output.put((String)key, p.getProperty((String)key));
+ }
+
return output;
}
@@ -112,11 +117,11 @@ private static void tryToClose(Reader in) {
* .git
* </pre>
*/
- private static String getModuleName(File moduleDir,
- Map<String, Object> config) {
+ private String getModuleName(File moduleDir,
+ Map<String, String> config) {
if (config.containsKey("module.name")) {
- return (String)config.get("module.name");
+ return config.get("module.name");
}
return moduleDir.getName();
@@ -55,7 +55,11 @@ function command.help() {
function command.build() {
- java -cp "$IBX_HOME/lib/*" ixcode.platform.build.ModuleBuilder "$CURRENT_DIR" "$@"
+ java -cp "$IBX_HOME/lib/*" ixcode.platform.build.ModuleBuilder "$CURRENT_DIR" "build" "$@"
+}
+
+function command.build() {
+ java -cp "$IBX_HOME/lib/*" ixcode.platform.build.ModuleBuilder "$CURRENT_DIR" "clean" "$@"
}
function command.install() {
View
@@ -1 +1 @@
-module.name=platform-core
+module.name=platform-core

0 comments on commit e6661ba

Please sign in to comment.