flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cd...@apache.org
Subject svn commit: r1441894 - in /flex/utilities/trunk/mavenizer/src/main/java: ./ air/ common/ flex/
Date Sun, 03 Feb 2013 11:43:39 GMT
Author: cdutz
Date: Sun Feb  3 11:43:39 2013
New Revision: 1441894

URL: http://svn.apache.org/viewvc?rev=1441894&view=rev
Log:
- Updated the Mavenizer to generate the Air jars to com.adobe.air.compiler.
- Introduced a "useApache" variable to control if an apache fdk should be generated using
the adobe groupId.
- Fine-tuned the generated air framework pom.
- Changed the Mavenizer to generate developer-build with a "-SNAPSHOT" version.

Added:
    flex/utilities/trunk/mavenizer/src/main/java/air/AirCompilerGenerator.java
      - copied, changed from r1438867, flex/utilities/trunk/mavenizer/src/main/java/flex/FlexCompilerGenerator.java
Modified:
    flex/utilities/trunk/mavenizer/src/main/java/SDKGenerator.java
    flex/utilities/trunk/mavenizer/src/main/java/air/AirFrameworkGenerator.java
    flex/utilities/trunk/mavenizer/src/main/java/air/AirRuntimeGenerator.java
    flex/utilities/trunk/mavenizer/src/main/java/common/BaseGenerator.java
    flex/utilities/trunk/mavenizer/src/main/java/flex/FlexCompilerGenerator.java
    flex/utilities/trunk/mavenizer/src/main/java/flex/FlexFrameworkGenerator.java
    flex/utilities/trunk/mavenizer/src/main/java/flex/FlexRuntimeGenerator.java

Modified: flex/utilities/trunk/mavenizer/src/main/java/SDKGenerator.java
URL: http://svn.apache.org/viewvc/flex/utilities/trunk/mavenizer/src/main/java/SDKGenerator.java?rev=1441894&r1=1441893&r2=1441894&view=diff
==============================================================================
--- flex/utilities/trunk/mavenizer/src/main/java/SDKGenerator.java (original)
+++ flex/utilities/trunk/mavenizer/src/main/java/SDKGenerator.java Sun Feb  3 11:43:39 2013
@@ -18,6 +18,8 @@ import java.io.*;
 import java.util.ArrayList;
 import java.util.List;
 import javax.xml.parsers.*;
+
+import air.AirCompilerGenerator;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.xml.sax.SAXException;
@@ -75,11 +77,14 @@ public class SDKGenerator {
     }
 
     public void generateAir(final File sdkSourceDirectory, final File sdkTargetDirectory,
final String sdkVersion) throws Exception {
+        // Generate the artifacts, needed by the air compiler.
+        new AirCompilerGenerator().process(sdkSourceDirectory, false, sdkTargetDirectory,
sdkVersion, false);
+
         // Generate the artifacts, needed by the flex application.
-        new AirFrameworkGenerator().process(sdkSourceDirectory, false, sdkTargetDirectory,
sdkVersion);
+        new AirFrameworkGenerator().process(sdkSourceDirectory, false, sdkTargetDirectory,
sdkVersion, false);
 
         // Deploy the FlashPlayer and AIR runtime binaries.
-        new AirRuntimeGenerator().process(sdkSourceDirectory, false, sdkTargetDirectory,
sdkVersion);
+        new AirRuntimeGenerator().process(sdkSourceDirectory, false, sdkTargetDirectory,
sdkVersion, false);
     }
 
     public void generateAllFlex(File sdkSourceDirectory, File sdkTargetDirectory) throws
Exception {
@@ -104,23 +109,24 @@ public class SDKGenerator {
                 System.out.println("---------------------------------------------");
 
                 // TODO: Comment this line in to deploy the apache flex under org.apache.flex
-                //generateFlex(sdkDirectory, isApache, sdkTargetDirectory, sdkVersion);
-                generateFlex(sdkDirectory, false, sdkTargetDirectory, sdkVersion);
+                //generateFlex(sdkDirectory, isApache, sdkTargetDirectory, sdkVersion, true);
+                generateFlex(sdkDirectory, isApache, sdkTargetDirectory, sdkVersion, false);
 
                 System.out.println("---------------------------------------------");
             }
         }
     }
 
-    public void generateFlex(final File sdkSourceDirectory, final boolean isApache, final
File sdkTargetDirectory, final String sdkVersion) throws Exception {
+    public void generateFlex(final File sdkSourceDirectory, final boolean isApache, final
File sdkTargetDirectory,
+                             final String sdkVersion, final boolean useApache) throws Exception
{
         // Generate the artifacts, needed by the flex compiler.
-        new FlexCompilerGenerator().process(sdkSourceDirectory, isApache, sdkTargetDirectory,
sdkVersion);
+        new FlexCompilerGenerator().process(sdkSourceDirectory, isApache, sdkTargetDirectory,
sdkVersion, useApache);
 
         // Generate the artifacts, needed by the flex application.
-        new FlexFrameworkGenerator().process(sdkSourceDirectory, isApache, sdkTargetDirectory,
sdkVersion);
+        new FlexFrameworkGenerator().process(sdkSourceDirectory, isApache, sdkTargetDirectory,
sdkVersion, useApache);
 
         // Deploy the FlashPlayer and AIR runtime binaries.
-        new FlexRuntimeGenerator().process(sdkSourceDirectory, isApache, sdkTargetDirectory,
sdkVersion);
+        new FlexRuntimeGenerator().process(sdkSourceDirectory, isApache, sdkTargetDirectory,
sdkVersion, useApache);
     }
 
     public static void main(String[] args) throws Exception {
@@ -205,7 +211,7 @@ public class SDKGenerator {
             final String build = root.getElementsByTagName("build").item(0).getTextContent();
 
             // In general the version consists of the content of the version element with
an appended build-number.
-            String sdkVersion = version + "." + build;
+            String sdkVersion = (build.equals("0")) ? version + "-SNAPSHOT" : version + "."
+ build;
 
             // Deal with the patched re-releases of all older SDKs:
             // The patched versions have A or B appended to their name and not a modified
version or build number.

Copied: flex/utilities/trunk/mavenizer/src/main/java/air/AirCompilerGenerator.java (from r1438867,
flex/utilities/trunk/mavenizer/src/main/java/flex/FlexCompilerGenerator.java)
URL: http://svn.apache.org/viewvc/flex/utilities/trunk/mavenizer/src/main/java/air/AirCompilerGenerator.java?p2=flex/utilities/trunk/mavenizer/src/main/java/air/AirCompilerGenerator.java&p1=flex/utilities/trunk/mavenizer/src/main/java/flex/FlexCompilerGenerator.java&r1=1438867&r2=1441894&rev=1441894&view=diff
==============================================================================
--- flex/utilities/trunk/mavenizer/src/main/java/flex/FlexCompilerGenerator.java (original)
+++ flex/utilities/trunk/mavenizer/src/main/java/air/AirCompilerGenerator.java Sun Feb  3
11:43:39 2013
@@ -14,62 +14,43 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package flex;
+package air;
 
-import java.io.*;
-import java.util.*;
-import java.util.zip.*;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
 import common.BaseGenerator;
 import common.MavenMetadata;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * Created with IntelliJ IDEA.
  * User: cdutz
- * Date: 11.05.12
- * Time: 14:53
+ * Date: 02.02.13
+ * Time: 13:41
  */
-public class FlexCompilerGenerator extends BaseGenerator {
+public class AirCompilerGenerator extends BaseGenerator {
 
-    public void process(final File sdkSourceDirectory, final boolean isApache, final File
sdkTargetDirectory, final String sdkVersion)
+    public void process(final File sdkSourceDirectory, final boolean isApache, final File
sdkTargetDirectory,
+                        final String sdkVersion, boolean useApache)
             throws Exception {
 
         final File sdkCompilerLibsDirectory = new File(sdkSourceDirectory, "lib");
         final List<File> jars = new ArrayList<File>();
         jars.addAll(Arrays.asList(sdkCompilerLibsDirectory.listFiles(new FilenameFilter()
{
             public boolean accept(File dir, String name) {
-                return name.endsWith(".jar");
+                return name.equalsIgnoreCase("adt.jar") ||
+                        name.equalsIgnoreCase("baksmali.jar") ||
+                        name.equalsIgnoreCase("smali.jar");
             }
         })));
 
-        // The Apache SDKs have an additional "external" directory
-        // containing external libs. These have to be added too.
-        final File externalLibsDirectory = new File(sdkCompilerLibsDirectory, "external");
-        if(externalLibsDirectory.exists() && externalLibsDirectory.isDirectory())
{
-            final File[] externalJars = externalLibsDirectory.listFiles(new FilenameFilter()
{
-                public boolean accept(File dir, String name) {
-                    return name.endsWith(".jar");
-                }
-            });
-            jars.addAll(Arrays.asList(externalJars));
-        }
-
-        // The Apache SDKs have an additional "optional" directory
-        // containing external libs. These have to be added too.
-        final File optionalLibsDirectory = new File(externalLibsDirectory, "optional");
-        if (optionalLibsDirectory.exists() && optionalLibsDirectory.isDirectory())
{
-            final File[] optionalJars = optionalLibsDirectory.listFiles(new FilenameFilter()
{
-                public boolean accept(File dir, String name) {
-                    return name.endsWith(".jar");
-                }
-            });
-            jars.addAll(Arrays.asList(optionalJars));
-        }
-
         // A pom artifact will be generated that has all libs as a dependency.
         final MavenMetadata metadata = new MavenMetadata();
-        metadata.setGroupId((isApache) ? "org.apache.flex" : "com.adobe.flex");
+        metadata.setGroupId("com.adobe.air");
         metadata.setArtifactId("compiler");
         metadata.setVersion(sdkVersion);
         metadata.setPackaging("pom");
@@ -118,15 +99,15 @@ public class FlexCompilerGenerator exten
 
                     // Generate a new metadata object
                     artifactMetadata = new MavenMetadata();
-                    artifactMetadata.setGroupId((isApache) ? "org.apache.flex.compiler" :
"com.adobe.flex.compiler");
+                    artifactMetadata.setGroupId("com.adobe.air.compiler");
                     artifactMetadata.setArtifactId(dependencyArtifactId);
                     artifactMetadata.setVersion(sdkVersion);
                     artifactMetadata.setPackaging("jar");
 
                     // Create the name of the directory that will contain the artifact.
                     final File targetJarDirectory = new File(sdkTargetDirectory,
-                            ((isApache) ? "org/apache/flex/compiler/" : "com/adobe/flex/compiler/")
+
-                            artifactMetadata.getArtifactId() + "/" + artifactMetadata.getVersion());
+                            "com/adobe/air/compiler/" + artifactMetadata.getArtifactId()
+ "/" +
+                                    artifactMetadata.getVersion());
                     // Create the directory.
                     if(targetJarDirectory.mkdirs()) {
                         // Create the filename of the artifact.
@@ -147,15 +128,6 @@ public class FlexCompilerGenerator exten
                     final File artifactPomFile =
                             new File(targetJarDirectory, dependencyArtifactId + "-" + sdkVersion
+ ".pom");
                     writeDocument(artifactPom, artifactPomFile);
-
-                    // The asdoc library needs us to zip up an additional directory and
-                    // deploy that as "asdoc-{version}-template.zip"
-                    if("asdoc".equals(dependencyArtifactId)) {
-                        final File asdocTemplatesDirectory = new File(sdkSourceDirectory,
"asdoc/templates");
-                        if(asdocTemplatesDirectory.exists()) {
-                            createAsdocTemplatesZip(asdocTemplatesDirectory, targetJarDirectory,
sdkVersion);
-                        }
-                    }
                 }
 
                 // Remember the checksum for later re-usage.
@@ -169,7 +141,7 @@ public class FlexCompilerGenerator exten
         // was needed due to the re-deployment of patched FDKs in 2011/2012 in which the
framework.swc no longer
         // has the same version as the compiler.
         final MavenMetadata frameworkVersions = new MavenMetadata();
-        frameworkVersions.setGroupId((isApache) ? "org.apache.flex" : "com.adobe.flex");
+        frameworkVersions.setGroupId("com.adobe.air");
         frameworkVersions.setArtifactId("framework");
         frameworkVersions.setVersion(sdkVersion);
         frameworkVersions.setPackaging("pom");
@@ -177,62 +149,8 @@ public class FlexCompilerGenerator exten
 
         // Write the compiler-pom document to file.
         final File pomFile = new File(sdkTargetDirectory,
-                ((isApache) ? "org/apache/flex/compiler/" : "com/adobe/flex/compiler/") +
sdkVersion + "/compiler-" + sdkVersion + ".pom");
+                "com/adobe/air/compiler/" + sdkVersion + "/compiler-" + sdkVersion + ".pom");
         writeDocument(pom, pomFile);
     }
 
-    /**
-     * Zips up the stuff in the asdoc templates directory.
-     *
-     * @param asdocTemplatesDirectory asdoc templates directory
-     * @param asdocDestinationDir directory containing the asdoc lib
-     * @param asdocVersion version of the asdoc lib
-     * @throws Exception
-     */
-    private void createAsdocTemplatesZip(File asdocTemplatesDirectory, File asdocDestinationDir,
String asdocVersion) throws Exception {
-        // ZIP up every file (not directory) in the framework directory and the entire themes
directory.
-        final File sourceFiles[] = asdocTemplatesDirectory.listFiles(new FileFilter() {
-            public boolean accept(File pathname) {
-                return pathname.isFile();
-            }
-        });
-        final File zipInputFiles[] = new File[sourceFiles.length + 1];
-        System.arraycopy(sourceFiles, 0, zipInputFiles, 0, sourceFiles.length);
-        final File imagesDirectory = new File(asdocTemplatesDirectory, "images");
-        zipInputFiles[sourceFiles.length] = imagesDirectory;
-
-        // Add all the content to a zip-file.
-        final File targetFile = new File(asdocDestinationDir,
-                "asdoc-" + asdocVersion + "-template.zip");
-        final ZipOutputStream zipOutputStream = new ZipOutputStream(new FileOutputStream(targetFile));
-        for(final File file : zipInputFiles) {
-            addFileToZip(zipOutputStream, file, asdocTemplatesDirectory);
-        }
-        zipOutputStream.close();
-    }
-
-    private void addFileToZip(ZipOutputStream zipOutputStream, File inputFile, File rootDirectory)
throws Exception {
-        // If this is a directory, add all it's children.
-        if(inputFile.isDirectory()) {
-            final File directoryContent[] = inputFile.listFiles();
-            if(directoryContent != null) {
-                for(final File file : directoryContent) {
-                    addFileToZip(zipOutputStream, file, rootDirectory);
-                }
-            }
-        }
-        // If this is a file, add it to the zips output.
-        else {
-            byte[] buf = new byte[1024];
-            final FileInputStream in = new FileInputStream(inputFile);
-            final String zipPath = inputFile.getAbsolutePath().substring(rootDirectory.getAbsolutePath().length()
+ 1);
-            zipOutputStream.putNextEntry(new ZipEntry(zipPath));
-            int len;
-            while ((len = in.read(buf)) > 0) {
-                zipOutputStream.write(buf, 0, len);
-            }
-            zipOutputStream.closeEntry();
-            in.close();
-        }
-    }
 }

Modified: flex/utilities/trunk/mavenizer/src/main/java/air/AirFrameworkGenerator.java
URL: http://svn.apache.org/viewvc/flex/utilities/trunk/mavenizer/src/main/java/air/AirFrameworkGenerator.java?rev=1441894&r1=1441893&r2=1441894&view=diff
==============================================================================
--- flex/utilities/trunk/mavenizer/src/main/java/air/AirFrameworkGenerator.java (original)
+++ flex/utilities/trunk/mavenizer/src/main/java/air/AirFrameworkGenerator.java Sun Feb  3
11:43:39 2013
@@ -34,7 +34,8 @@ public class AirFrameworkGenerator exten
     protected Map<String, String> libraryVersions = new HashMap<String, String>();
     protected Map<String, String> libraryLocations = new HashMap<String, String>();
 
-    public void process(File sdkSourceDirectory, final boolean isApache, File sdkTargetDirectory,
String sdkVersion)
+    public void process(File sdkSourceDirectory, final boolean isApache, File sdkTargetDirectory,
String sdkVersion,
+                        boolean useApache)
             throws Exception
     {
         final File frameworksDirectory = new File(sdkSourceDirectory, "frameworks");
@@ -51,7 +52,6 @@ public class AirFrameworkGenerator exten
             throws Exception
     {
         final MavenMetadata groupMetadata = new MavenMetadata();
-	    String groupMetadataId = groupId;
         groupMetadata.setGroupId(groupId.substring(0, groupId.lastIndexOf(".")));
         groupMetadata.setArtifactId(groupId.substring(groupId.lastIndexOf(".") + 1, groupId.length()));
         groupMetadata.setVersion(sdkVersion);
@@ -109,7 +109,7 @@ public class AirFrameworkGenerator exten
         }
 
         final MavenMetadata commonFrameworkMetaData = new MavenMetadata();
-        commonFrameworkMetaData.setGroupId(groupMetadataId);
+        commonFrameworkMetaData.setGroupId(groupId);
         commonFrameworkMetaData.setArtifactId("common-framework");
         commonFrameworkMetaData.setVersion(groupMetadata.getVersion());
         commonFrameworkMetaData.setPackaging("pom");
@@ -127,15 +127,6 @@ public class AirFrameworkGenerator exten
                         groupMetadata.getVersion() + ".pom");
         generateSwcPom(commonFrameworkPom, commonFrameworkMetaData);
 
-        // Generate a dummy entry for the "flex-framework" pom,
-        // which will be generated later in the process.
-        final MavenMetadata flexFrameworkMetadata = new MavenMetadata();
-        flexFrameworkMetadata.setGroupId(groupMetadataId);
-        flexFrameworkMetadata.setArtifactId("flex-framework");
-        flexFrameworkMetadata.setVersion(groupMetadata.getVersion());
-        flexFrameworkMetadata.setPackaging("pom");
-        groupMetadata.getDependencies().add(flexFrameworkMetadata);
-
         // Generate the master pom for the current library (Pom that defines
         // all versions of the current sdk libraries.
         final File groupPomFile = new File(targetDirectory,

Modified: flex/utilities/trunk/mavenizer/src/main/java/air/AirRuntimeGenerator.java
URL: http://svn.apache.org/viewvc/flex/utilities/trunk/mavenizer/src/main/java/air/AirRuntimeGenerator.java?rev=1441894&r1=1441893&r2=1441894&view=diff
==============================================================================
--- flex/utilities/trunk/mavenizer/src/main/java/air/AirRuntimeGenerator.java (original)
+++ flex/utilities/trunk/mavenizer/src/main/java/air/AirRuntimeGenerator.java Sun Feb  3 11:43:39
2013
@@ -35,7 +35,8 @@ import java.util.Locale;
 public class AirRuntimeGenerator extends BaseGenerator {
 
     @Override
-    public void process(File sdkSourceDirectory, boolean isApache, File sdkTargetDirectory,
String sdkVersion)
+    public void process(File sdkSourceDirectory, boolean isApache, File sdkTargetDirectory,
String sdkVersion,
+                        boolean useApache)
             throws Exception
     {
         processFlashRuntime(sdkSourceDirectory, sdkTargetDirectory);

Modified: flex/utilities/trunk/mavenizer/src/main/java/common/BaseGenerator.java
URL: http://svn.apache.org/viewvc/flex/utilities/trunk/mavenizer/src/main/java/common/BaseGenerator.java?rev=1441894&r1=1441893&r2=1441894&view=diff
==============================================================================
--- flex/utilities/trunk/mavenizer/src/main/java/common/BaseGenerator.java (original)
+++ flex/utilities/trunk/mavenizer/src/main/java/common/BaseGenerator.java Sun Feb  3 11:43:39
2013
@@ -49,7 +49,7 @@ public abstract class BaseGenerator {
     // Artifactory: "http://server:port/artifactory/api/search/checksum?repos=libs-release-local&md5=04040c7c184620af0a0a8a3682a75eb7
     // Nexus: "http://repository.sonatype.org/service/local/data_index?a=04040c7c184620af0a0a8a3682a75eb7"
 
-    abstract public void process(File sdkSourceDirectory, boolean isApache, File sdkTargetDirectory,
String sdkVersion)
+    abstract public void process(File sdkSourceDirectory, boolean isApache, File sdkTargetDirectory,
String sdkVersion, boolean useApache)
             throws Exception;
 
     protected String calculateChecksum(File jarFile) throws Exception {

Modified: flex/utilities/trunk/mavenizer/src/main/java/flex/FlexCompilerGenerator.java
URL: http://svn.apache.org/viewvc/flex/utilities/trunk/mavenizer/src/main/java/flex/FlexCompilerGenerator.java?rev=1441894&r1=1441893&r2=1441894&view=diff
==============================================================================
--- flex/utilities/trunk/mavenizer/src/main/java/flex/FlexCompilerGenerator.java (original)
+++ flex/utilities/trunk/mavenizer/src/main/java/flex/FlexCompilerGenerator.java Sun Feb 
3 11:43:39 2013
@@ -32,14 +32,18 @@ import common.MavenMetadata;
  */
 public class FlexCompilerGenerator extends BaseGenerator {
 
-    public void process(final File sdkSourceDirectory, final boolean isApache, final File
sdkTargetDirectory, final String sdkVersion)
+    public void process(final File sdkSourceDirectory, final boolean isApache, final File
sdkTargetDirectory,
+                        final String sdkVersion, boolean useApache)
             throws Exception {
 
         final File sdkCompilerLibsDirectory = new File(sdkSourceDirectory, "lib");
         final List<File> jars = new ArrayList<File>();
+        // In the Adobe Flex SDKs there can be 3 jars, that are actually part of the air
sdk, so we manually
+        // exclude these from the flex-compiler.
         jars.addAll(Arrays.asList(sdkCompilerLibsDirectory.listFiles(new FilenameFilter()
{
             public boolean accept(File dir, String name) {
-                return name.endsWith(".jar");
+                return name.endsWith(".jar") && !(name.equalsIgnoreCase("adt.jar")
||
+                        name.equalsIgnoreCase("baksmali.jar") || name.equalsIgnoreCase("smali.jar"));
             }
         })));
 
@@ -69,7 +73,7 @@ public class FlexCompilerGenerator exten
 
         // A pom artifact will be generated that has all libs as a dependency.
         final MavenMetadata metadata = new MavenMetadata();
-        metadata.setGroupId((isApache) ? "org.apache.flex" : "com.adobe.flex");
+        metadata.setGroupId((isApache && useApache) ? "org.apache.flex" : "com.adobe.flex");
         metadata.setArtifactId("compiler");
         metadata.setVersion(sdkVersion);
         metadata.setPackaging("pom");
@@ -118,14 +122,15 @@ public class FlexCompilerGenerator exten
 
                     // Generate a new metadata object
                     artifactMetadata = new MavenMetadata();
-                    artifactMetadata.setGroupId((isApache) ? "org.apache.flex.compiler" :
"com.adobe.flex.compiler");
+                    artifactMetadata.setGroupId((isApache && useApache) ? "org.apache.flex.compiler"
:
+                            "com.adobe.flex.compiler");
                     artifactMetadata.setArtifactId(dependencyArtifactId);
                     artifactMetadata.setVersion(sdkVersion);
                     artifactMetadata.setPackaging("jar");
 
                     // Create the name of the directory that will contain the artifact.
                     final File targetJarDirectory = new File(sdkTargetDirectory,
-                            ((isApache) ? "org/apache/flex/compiler/" : "com/adobe/flex/compiler/")
+
+                            ((isApache && useApache) ? "org/apache/flex/compiler/"
: "com/adobe/flex/compiler/") +
                             artifactMetadata.getArtifactId() + "/" + artifactMetadata.getVersion());
                     // Create the directory.
                     if(targetJarDirectory.mkdirs()) {
@@ -139,7 +144,8 @@ public class FlexCompilerGenerator exten
                         // Add the dependency to the compiler-poms dependency section.
                         appendArtifact(artifactMetadata, dependencies);
                     } else {
-                        throw new RuntimeException("Could not create directory: " + targetJarDirectory.getAbsolutePath());
+                        throw new RuntimeException("Could not create directory: " +
+                                targetJarDirectory.getAbsolutePath());
                     }
 
                     // Create the pom document that will reside next to the artifact lib.
@@ -169,7 +175,7 @@ public class FlexCompilerGenerator exten
         // was needed due to the re-deployment of patched FDKs in 2011/2012 in which the
framework.swc no longer
         // has the same version as the compiler.
         final MavenMetadata frameworkVersions = new MavenMetadata();
-        frameworkVersions.setGroupId((isApache) ? "org.apache.flex" : "com.adobe.flex");
+        frameworkVersions.setGroupId((isApache && useApache) ? "org.apache.flex"
: "com.adobe.flex");
         frameworkVersions.setArtifactId("framework");
         frameworkVersions.setVersion(sdkVersion);
         frameworkVersions.setPackaging("pom");
@@ -177,7 +183,8 @@ public class FlexCompilerGenerator exten
 
         // Write the compiler-pom document to file.
         final File pomFile = new File(sdkTargetDirectory,
-                ((isApache) ? "org/apache/flex/compiler/" : "com/adobe/flex/compiler/") +
sdkVersion + "/compiler-" + sdkVersion + ".pom");
+                ((isApache && useApache) ? "org/apache/flex/compiler/" : "com/adobe/flex/compiler/")
+
+                        sdkVersion + "/compiler-" + sdkVersion + ".pom");
         writeDocument(pom, pomFile);
     }
 
@@ -189,7 +196,8 @@ public class FlexCompilerGenerator exten
      * @param asdocVersion version of the asdoc lib
      * @throws Exception
      */
-    private void createAsdocTemplatesZip(File asdocTemplatesDirectory, File asdocDestinationDir,
String asdocVersion) throws Exception {
+    private void createAsdocTemplatesZip(File asdocTemplatesDirectory, File asdocDestinationDir,
String asdocVersion)
+            throws Exception {
         // ZIP up every file (not directory) in the framework directory and the entire themes
directory.
         final File sourceFiles[] = asdocTemplatesDirectory.listFiles(new FileFilter() {
             public boolean accept(File pathname) {

Modified: flex/utilities/trunk/mavenizer/src/main/java/flex/FlexFrameworkGenerator.java
URL: http://svn.apache.org/viewvc/flex/utilities/trunk/mavenizer/src/main/java/flex/FlexFrameworkGenerator.java?rev=1441894&r1=1441893&r2=1441894&view=diff
==============================================================================
--- flex/utilities/trunk/mavenizer/src/main/java/flex/FlexFrameworkGenerator.java (original)
+++ flex/utilities/trunk/mavenizer/src/main/java/flex/FlexFrameworkGenerator.java Sun Feb
 3 11:43:39 2013
@@ -62,12 +62,13 @@ public class FlexFrameworkGenerator exte
         skipArtifacts.add("flex3");
     }
 
-    public void process(File sdkSourceDirectory, final boolean isApache, File sdkTargetDirectory,
String sdkVersion)
+    public void process(File sdkSourceDirectory, final boolean isApache, File sdkTargetDirectory,
String sdkVersion,
+                        boolean useApache)
             throws Exception {
         final File frameworksDirectory = new File(sdkSourceDirectory, "frameworks");
         final File rslsDirectory = new File(frameworksDirectory, "rsls");
         final File targetBaseDirectory = new File(sdkTargetDirectory,
-                (isApache) ? "org/apache/flex/framework" : "com/adobe/flex/framework");
+                (isApache && useApache) ? "org/apache/flex/framework" : "com/adobe/flex/framework");
 
         // Look at the RSLs first, as these have version numbers.
         // This makes it possible to deploy the swcs with the correct versions.
@@ -84,8 +85,6 @@ public class FlexFrameworkGenerator exte
                 final String libraryName = rslName.substring(0, rslName.lastIndexOf("_"));
                 final String libraryVersion = rslName.substring(rslName.lastIndexOf("_")
+ 1, rslName.lastIndexOf("."));
                 libraryVersions.put(libraryName, libraryVersion);
-                // TODO: Supporting different versions would result in major problems in
the flexmojos build.
-                //libraryVersions.put(libraryName, sdkVersion);
             }
         }
 
@@ -116,14 +115,14 @@ public class FlexFrameworkGenerator exte
         // Generate the artifacts based upon the structure of the libraries in the lib-directory.
         final File swcsDirectory = new File(frameworksDirectory, "libs");
         generateArtifactsForDirectory(swcsDirectory, targetBaseDirectory, sdkVersion,
-                (isApache) ? "org.apache.flex.framework" : "com.adobe.flex.framework",
-                false, isApache);
+                (isApache && useApache) ? "org.apache.flex.framework" : "com.adobe.flex.framework",
+                false, isApache && useApache);
 
         // Deploy the playerglobal in it's own groupId as this is not directly linked to
flex.
         final File playerRootDirectory = new File(sdkTargetDirectory, "com/adobe/flash");
         generatePlayerglobalArtifacts(new File(swcsDirectory, "player"), new File(playerRootDirectory,
"framework"));
         final String minimumFlashPlayerVersion = getMinimumPlayerVersion(frameworksDirectory);
-        generateFlexFrameworkPom(targetBaseDirectory, sdkVersion, isApache, minimumFlashPlayerVersion);
+        generateFlexFrameworkPom(targetBaseDirectory, sdkVersion, isApache && useApache,
minimumFlashPlayerVersion);
 
         // After processing the swcs the locations for the libraries will be
         // available and the swfs and swzs can be deployed.
@@ -219,7 +218,7 @@ public class FlexFrameworkGenerator exte
         // Deploy all the swcs in the themes directory.
         final File themesSrcDirectory = new File(frameworksDirectory, "themes");
         if(themesSrcDirectory.exists()) {
-            generateThemeArtifacts(themesSrcDirectory, targetBaseDirectory, sdkVersion, isApache);
+            generateThemeArtifacts(themesSrcDirectory, targetBaseDirectory, sdkVersion, isApache
&& useApache);
         }
     }
 
@@ -228,7 +227,6 @@ public class FlexFrameworkGenerator exte
                                                  boolean skipGroupPomGeneration, final boolean
isApache)
             throws Exception {
         final MavenMetadata groupMetadata = new MavenMetadata();
-	    String groupMetadataId = groupId;
         groupMetadata.setGroupId(groupId.substring(0, groupId.lastIndexOf(".")));
         groupMetadata.setArtifactId(groupId.substring(groupId.lastIndexOf(".") + 1, groupId.length()));
         groupMetadata.setVersion(sdkVersion);
@@ -350,7 +348,7 @@ public class FlexFrameworkGenerator exte
             // the dependencies the same way velos sdks did.
             if ("libs".equals(sourceDirectory.getName())) {
                 final MavenMetadata commonFrameworkMetaData = new MavenMetadata();
-                commonFrameworkMetaData.setGroupId(groupMetadataId);
+                commonFrameworkMetaData.setGroupId(groupId);
                 commonFrameworkMetaData.setArtifactId("common-framework");
                 commonFrameworkMetaData.setVersion(groupMetadata.getVersion());
                 commonFrameworkMetaData.setPackaging("pom");
@@ -371,14 +369,14 @@ public class FlexFrameworkGenerator exte
                 // Generate a dummy entry for the "flex-framework" pom,
                 // which will be generated later in the process.
                 final MavenMetadata flexFrameworkMetadata = new MavenMetadata();
-                flexFrameworkMetadata.setGroupId(groupMetadataId);
+                flexFrameworkMetadata.setGroupId(groupId);
                 flexFrameworkMetadata.setArtifactId("flex-framework");
                 flexFrameworkMetadata.setVersion(groupMetadata.getVersion());
                 flexFrameworkMetadata.setPackaging("pom");
                 groupMetadata.getDependencies().add(flexFrameworkMetadata);
             } else if ("air".equals(sourceDirectory.getName())) {
                 final MavenMetadata airCommonFrameworkMetaData = new MavenMetadata();
-                airCommonFrameworkMetaData.setGroupId(groupMetadataId);
+                airCommonFrameworkMetaData.setGroupId(groupId);
                 airCommonFrameworkMetaData.setArtifactId("common-framework");
                 airCommonFrameworkMetaData.setVersion(groupMetadata.getVersion());
                 airCommonFrameworkMetaData.setPackaging("pom");
@@ -399,7 +397,7 @@ public class FlexFrameworkGenerator exte
                 // Generate a dummy entry for the "flex-framework" pom,
                 // which will be generated later in the process.
                 final MavenMetadata flexFrameworkMetadata = new MavenMetadata();
-                flexFrameworkMetadata.setGroupId(groupMetadataId);
+                flexFrameworkMetadata.setGroupId(groupId);
                 flexFrameworkMetadata.setArtifactId("air-framework");
                 flexFrameworkMetadata.setVersion(groupMetadata.getVersion());
                 flexFrameworkMetadata.setPackaging("pom");

Modified: flex/utilities/trunk/mavenizer/src/main/java/flex/FlexRuntimeGenerator.java
URL: http://svn.apache.org/viewvc/flex/utilities/trunk/mavenizer/src/main/java/flex/FlexRuntimeGenerator.java?rev=1441894&r1=1441893&r2=1441894&view=diff
==============================================================================
--- flex/utilities/trunk/mavenizer/src/main/java/flex/FlexRuntimeGenerator.java (original)
+++ flex/utilities/trunk/mavenizer/src/main/java/flex/FlexRuntimeGenerator.java Sun Feb  3
11:43:39 2013
@@ -35,7 +35,8 @@ import java.util.Locale;
 public class FlexRuntimeGenerator extends BaseGenerator {
 
     @Override
-    public void process(File sdkSourceDirectory, boolean isApache, File sdkTargetDirectory,
String sdkVersion)
+    public void process(File sdkSourceDirectory, boolean isApache, File sdkTargetDirectory,
String sdkVersion,
+                        boolean useApache)
             throws Exception
     {
         processFlashRuntime(sdkSourceDirectory, sdkTargetDirectory);



Mime
View raw message