- Created a LegacyToolGroup - Fine-tuned the flex-tool-api implementation. - Converted DigestTool into a FlexTool
diff --git a/modules/compiler/src/java/flex2/tools/ASDoc.java b/modules/compiler/src/java/flex2/tools/ASDoc.java index a8c5fde..82541d6 100644 --- a/modules/compiler/src/java/flex2/tools/ASDoc.java +++ b/modules/compiler/src/java/flex2/tools/ASDoc.java
@@ -42,7 +42,7 @@ @Override public String getName() { - return "ASDOC"; + return FLEX_TOOL_ASDOC; } @Override
diff --git a/modules/compiler/src/java/flex2/tools/Compc.java b/modules/compiler/src/java/flex2/tools/Compc.java index 9591850..184d407 100644 --- a/modules/compiler/src/java/flex2/tools/Compc.java +++ b/modules/compiler/src/java/flex2/tools/Compc.java
@@ -53,7 +53,7 @@ { @Override public String getName() { - return "COMPC"; + return FLEX_TOOL_COMPC; } @Override
diff --git a/modules/compiler/src/java/flex2/tools/DigestTool.java b/modules/compiler/src/java/flex2/tools/DigestTool.java index 6c93866..306a4de 100644 --- a/modules/compiler/src/java/flex2/tools/DigestTool.java +++ b/modules/compiler/src/java/flex2/tools/DigestTool.java
@@ -37,6 +37,7 @@ import flex2.compiler.swc.SwcGroup; import flex2.compiler.util.CompilerMessage; import flex2.compiler.util.ThreadLocalToolkit; +import org.apache.flex.tools.FlexTool; /** * Given the path to a file and a swc, update the digest xml in catalog.xml of the swc @@ -45,10 +46,21 @@ * @author dloverin * */ -public class DigestTool extends Tool +public class DigestTool extends Tool implements FlexTool { static private final String PROGRAM_NAME = "digest"; + @Override + public String getName() { + return FLEX_TOOL_DIGEST; + } + + @Override + public int execute(String[] args) { + digestTool(args); + return ThreadLocalToolkit.errorCount(); + } + /** * @param args */ @@ -86,8 +98,8 @@ DigestConfiguration configuration = rootConfiguration.getDigestConfiguration(); // load SWC - SwcCache cache = null; - File libraryFile = null; + SwcCache cache; + File libraryFile; BufferedInputStream libraryInput = null; try {
diff --git a/modules/compiler/src/java/flex2/tools/LegacyToolGroup.java b/modules/compiler/src/java/flex2/tools/LegacyToolGroup.java new file mode 100644 index 0000000..4884d61 --- /dev/null +++ b/modules/compiler/src/java/flex2/tools/LegacyToolGroup.java
@@ -0,0 +1,38 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 License for the specific language governing permissions and + * limitations under the License. + * + */ + +package flex2.tools; + +import org.apache.flex.tools.AbstractFlexToolGroup; + +/** + * FlexToolGroup exposing the implementations of the old legacy compilers tools. + */ +public class LegacyToolGroup extends AbstractFlexToolGroup { + + public LegacyToolGroup() { + super("Legacy"); + addFlexTool(new ASDoc()); + addFlexTool(new Compc()); + addFlexTool(new Mxmlc()); + addFlexTool(new DigestTool()); + addFlexTool(new Optimizer()); + } + +}
diff --git a/modules/compiler/src/java/flex2/tools/Mxmlc.java b/modules/compiler/src/java/flex2/tools/Mxmlc.java index 0854d1b..f48bd37 100644 --- a/modules/compiler/src/java/flex2/tools/Mxmlc.java +++ b/modules/compiler/src/java/flex2/tools/Mxmlc.java
@@ -60,7 +60,7 @@ @Override public String getName() { - return "MXMLC"; + return FLEX_TOOL_MXMLC; } @Override
diff --git a/modules/compiler/src/java/flex2/tools/Optimizer.java b/modules/compiler/src/java/flex2/tools/Optimizer.java index 0a7f679..bc496bf 100644 --- a/modules/compiler/src/java/flex2/tools/Optimizer.java +++ b/modules/compiler/src/java/flex2/tools/Optimizer.java
@@ -57,7 +57,7 @@ @Override public String getName() { - return "OPTIMIZER"; + return FLEX_TOOL_OPTIMIZER; } @Override
diff --git a/modules/downloads.xml b/modules/downloads.xml index 7c707e5..f9e8758 100644 --- a/modules/downloads.xml +++ b/modules/downloads.xml
@@ -572,7 +572,7 @@ <target name="flex-tool-api-jar" depends="flex-tool-api-jar-check" unless="flexToolApi.jar.exists" description="Downloads and copies flex-tool-api.jar to the lib directory."> - <get src="http://repository.apache.org/content/groups/snapshots/org/apache/flex/flex-tool-api/1.0.0-SNAPSHOT/flex-tool-api-1.0.0-20141105.140704-1.jar" + <get src="http://repository.apache.org/content/groups/snapshots/org/apache/flex/flex-tool-api/1.0.0-SNAPSHOT/flex-tool-api-1.0.0-20141110.132854-7.jar" dest="${download.dir}/flex-tool-api.jar" verbose="false"/>