You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cd...@apache.org on 2015/07/23 11:30:29 UTC
[04/13] git commit: [flex-utilities] [refs/heads/develop] - - Renamed
the root directory - Renamed the artifact of the maven-extension to
flex-sdk-converter-maven-extension
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/maven-flex-plugin/testsuite/projects/concepts/flex/general/simple-swf/pom.xml
----------------------------------------------------------------------
diff --git a/flex-maven-tools/maven-flex-plugin/testsuite/projects/concepts/flex/general/simple-swf/pom.xml b/flex-maven-tools/maven-flex-plugin/testsuite/projects/concepts/flex/general/simple-swf/pom.xml
deleted file mode 100644
index 0b8722d..0000000
--- a/flex-maven-tools/maven-flex-plugin/testsuite/projects/concepts/flex/general/simple-swf/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.apache.flex.testsuite</groupId>
- <artifactId>flex.general.simple-swf</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <packaging>swf</packaging>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-flex-plugin</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <extensions>true</extensions>
- <configuration>
- <useLegacyCompiler>false</useLegacyCompiler>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/maven-flex-plugin/testsuite/projects/concepts/flex/general/simple-swf/src/main/flex/Main.mxml
----------------------------------------------------------------------
diff --git a/flex-maven-tools/maven-flex-plugin/testsuite/projects/concepts/flex/general/simple-swf/src/main/flex/Main.mxml b/flex-maven-tools/maven-flex-plugin/testsuite/projects/concepts/flex/general/simple-swf/src/main/flex/Main.mxml
deleted file mode 100644
index c1d1f3b..0000000
--- a/flex-maven-tools/maven-flex-plugin/testsuite/projects/concepts/flex/general/simple-swf/src/main/flex/Main.mxml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
- 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.
-
--->
-<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
- xmlns:s="library://ns.adobe.com/flex/spark">
- <s:Label text="Hello World!"/>
-</s:Application>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/mavenizer/LICENSE
----------------------------------------------------------------------
diff --git a/flex-maven-tools/mavenizer/LICENSE b/flex-maven-tools/mavenizer/LICENSE
deleted file mode 100644
index 6b0b127..0000000
--- a/flex-maven-tools/mavenizer/LICENSE
+++ /dev/null
@@ -1,203 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- 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 License for the specific language governing permissions and
- limitations under the License.
-
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/mavenizer/NOTICE
----------------------------------------------------------------------
diff --git a/flex-maven-tools/mavenizer/NOTICE b/flex-maven-tools/mavenizer/NOTICE
deleted file mode 100644
index d1becf0..0000000
--- a/flex-maven-tools/mavenizer/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache Flex Mavenizer
-Copyright 2015 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/mavenizer/README.txt
----------------------------------------------------------------------
diff --git a/flex-maven-tools/mavenizer/README.txt b/flex-maven-tools/mavenizer/README.txt
deleted file mode 100644
index 7f84e76..0000000
--- a/flex-maven-tools/mavenizer/README.txt
+++ /dev/null
@@ -1,222 +0,0 @@
-Apache Flex SDK Converter
-=========================
- The Mavenizer tool is used to convert the Apache and Adobe Flex SDKs and Air
- SDKs into Maven artifacts. Automatically creating the Directories, pom-files,
- copying and moving the resources to the correct destinations.
-
- These artifacts can be used in Maven builds using the Flexmojos plugin
- (Starting with version 6.x).
-
- The Apache Flex SDK Converter comes with all the means to download, convert
- and deploy a mavenized form of an Apache Flex SDK.
-
- The Converter does not simply copy all java libraries to the destination; it checks
- if the given artifact has already been deployed to maven central or by deploying an
- other FDK previously. For this check you do need an internet connection to do the
- conversion, otherwise it will probably take forever.
-
- Internally it consists of 3 components:
- - One Retriever
- - DownloadRetriever: For downloading binary artifacts
- - Four Converters
- - One for producing the Apache Flex SDK artifacts
- - One for producing the Adobe Flash artifacts
- - One for producing the Adobe Air artifacts
- - One for producing the Adobe Fontkit artifacts
- - Two Deployers
- - One using Aether with no requirement to Maven (Faster, but less configurable)
- - One using a local Maven installation (A lot slower, but fully configurable)
-
-
-
-Getting the latest sources via git
-==================================
-
- Getting the source code is the recommended way to get the Apache Flex SDK
- Converter.
-
- You can always checkout the latest source via git using the following
- command:
-
- git clone https://git-wip-us.apache.org/repos/asf/flex-utilities.git flex-utilities
- cd flex-utilities/mavenizer
- git checkout develop
-
-Building the Apache Flex SDK Converter
-======================================
-
- The Apache Flex SDK Converter is a relatively simple project. It requires some
- build tools which must be installed prior to building the compiler and it depends
- on some external software which are downloaded as part of the build process.
- Some of these have different licenses. See the Software Dependencies section
- for more information on the external software dependencies.
-
-Install Prerequisites
----------------------
-
- Before building the Apache Flex Compiler you must install the following software
- and set the corresponding environment variables using absolute file paths.
- Relative file paths will result in build errors.
-
- ==================================================================================
- SOFTWARE ENVIRONMENT VARIABLE (absolute paths)
- ==================================================================================
-
- Java SDK 1.6 or greater (*1) JAVA_HOME
-
- Maven 3.1.0 or greater (*1) MAVEN_HOME
-
- ==================================================================================
-
- *1) The bin directories for MAVEN_HOME and JAVA_HOME should be added to your
- PATH.
-
- On Windows, set PATH to
-
- PATH=%PATH%;%MAVEN_HOME%\bin;%JAVA_HOME%\bin
-
- On the Mac (bash), set PATH to
-
- export PATH="$PATH:$MAVEN_HOME/bin:$JAVA_HOME/bin"
-
- On Linux make sure you path include MAVEN_HOME and JAVA_HOME.
-
-Software Dependencies
----------------------
-
- The Apache Flex SDK Converter uses third-party code that will be downloaded as
- part of the build.
-
- The Apache Version 2.0 license is in the LICENSE file.
-
- The following dependencies have licenses which are, or are compatible with,
- the Apache Version 2.0 license. You will not be prompted to acknowledge the
- download. Most of the jars are installed in your maven local repository and
- are included in the assembly jars.
-
-TODO: Add them all here ...
-
-Building the Source in the Source Distribution
-----------------------------------------------
-
- The project is built with Apache Maven so for a reference to Maven commands
- please have a look at the Maven documentation.
-
- When you have all the prerequisites in place and the environment variables
- set (see Install Prerequisites above) use
-
- cd <mavenizer.dir>
- mvn install
-
- to download the thirdparty dependencies and build the binary from the source.
-
- To clean the build, of everything other than the downloaded third-party
- dependencies use
-
- mvn clean
-
- The packages can be found in the "target" subdirectories.
-
- The particularly interesting one is the Standalone Command Line Interface:
- - cli/target/apache-flex-sdk-converter-1.0.0-SNAPSHOT.jar
-
-
-
-Using the Apache Flex SDK Converter
-===================================
-
- The CLI (Command Line Interface) allows the Apache Flex SDK Converter
- to be executed from the command-line. Assuming the Java executable is
- available on the current systems path, it can be called using:
-
- cd <mavenizer.dir>/cli/target
- java -jar apache-flex-sdk-converter-1.0.0-SNAPSHOT.jar
-
- If executed without any command, it will output a list of commands and
- available properties.
-
- In general it is able to perform 4 different commands:
-
- - help Prints a list of all commands and options available.
- - list Lists all versions and platforms available for download
- - download Downloads selected versions and assembles an FDK
- - convert Converts a previously installed (using the installer) or
- assembled (using download command) FDK into a mavenized form.
- - deploy Uploads previously created maven artifacts to a remote repository.
-
-Some typical usage scenarios
-----------------------------
-
- - Create a mavenized version of a previously installed FDK (Using the installer):
- "... -fdkDir <FDK install dir> -mavenDir <maven local repo> convert"
-
- - Download and create an FDK (Flex 4.14.1 with playerglobal 17.0 and 16.0
- AIR SDK 17.0 for Windows and Mac and the fontkit libs):
- "... -fdkDir <FDK target dir> -flexVersion 4.14.1 -flashVersions 17.0,16.0 \
- -airVersion 17.0 -platform WINDOWS,MAC -fontkit download"
-
- - Download and convert an FDK (FDK assembled in temp directory using Air for
- current systems platform only):
- "... -flexVersion 4.14.1 -flashVersions 17.0 -airVersion 17.0 -fontkit \
- -mavenDir <maven local repo> download convert"
-
- - Deploy a bunch of maven artifacts to a remote maven repository:
- "... -mavenDir <dir with maven artifacts> -repoUrl <url> \
- -repoUsername <username> -repoPassword <pasword> deploy"
-
- - "The works": Download, Convert and Deploy using only temp directories:
- "... -flexVersion 4.14.1 -flashVersions 17.0 -airVersion 17.0 -fontkit \
- -repoUrl <url> -repoUsername <username> -repoPassword <pasword> \
- download convert deploy"
-
-
-Thanks for using Apache Flex. Enjoy!
-
- The Apache Flex Project
- <http://flex.apache.org>
-
-
-
-
-
-/////////////////////////////////////////////////////////////////////////////////////////
-Some information (HOWTO) to go with the deployer artifacts
-/////////////////////////////////////////////////////////////////////////////////////////
-
-The deployers are separate modules. Currently two implementations exist.
-1. The Maven deployer (located in deployers/maven/target/maven-deployer-1.0.0-full.jar)
-2. The Aether deployer (located in deployers/aether/target/aether-deployer-1.0.0-full.jar)
-
-The Maven-Deployer expects Maven to be installed on your system and issues a set of
-commandline commands in order to deploy the artifacts. This is the safest approach if you
-haven any special settings that need to be handled in order to deploy the artifacts.
-
-The Aether-Deplyoer uses the Maven-Internal aether libraries to deploy the artifacts from
-within the running JVM. This makes this approach a lot faster than the Maven-Deployer.
-
-/////////////////////////////////////////
-Usage for the Maven Deployer:
-/////////////////////////////////////////
-
-java -cp {home}/deployers/maven/target/maven-deployer-1.0.0-full.jar "directory" "repositoryId" "url" "mvn"
-
-The Maven-Deployer needs 4 ordered parameters separated by spaces:
- 1- directory: The path to the directory to deploy.
- 2- repositoryId: Server Id to map on the <id> under <server> section of settings.xml.
- 3- url: URL where the artifacts will be deployed.
- 4- mvn: The path to the mvn.bat / mvn.sh.
-
-/////////////////////////////////////////
-Usage for the Maven Deployer:
-/////////////////////////////////////////
-
-java -cp {home}/deployers/aether/target/maven-aether-1.0.0-full.jar "directory" "url" ["username" "password]
-
-The Aether-Deployer needs 2 ordered parameters separated by spaces:
- 1- directory: The path to the directory to deploy.
- 2- url: URL where the artifacts will be deployed.
-Optionally you can provide the username and password that is used for deploying artifacts.
- 3- username: The username needed to log-in to the remote repository.
- 4- password: The password needed to log-in to the remote repository.
-
-
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/mavenizer/RELEASE_NOTES
----------------------------------------------------------------------
diff --git a/flex-maven-tools/mavenizer/RELEASE_NOTES b/flex-maven-tools/mavenizer/RELEASE_NOTES
deleted file mode 100644
index d51fd96..0000000
--- a/flex-maven-tools/mavenizer/RELEASE_NOTES
+++ /dev/null
@@ -1,19 +0,0 @@
-Apache Flex Mavenizer 1.0.0
-===========================
-
-Apache Flex Mavenizer 1.0.0 is the first release of a tool allowing, automating
-the conversion of Apache Flex FDKs into Maven artifacts that can be used by
-FlexMojos to build Apache Flex application using Maven.
-
-Known Issues
-_____________
-
-Currently None.
-
-
-Please report new issues to our bug tracker at:
-
- https://issues.apache.org/jira/browse/FLEX
-
- The Apache Flex Project
- <http://flex.apache.org/>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/mavenizer/cli/pom.xml
----------------------------------------------------------------------
diff --git a/flex-maven-tools/mavenizer/cli/pom.xml b/flex-maven-tools/mavenizer/cli/pom.xml
deleted file mode 100644
index 511ac31..0000000
--- a/flex-maven-tools/mavenizer/cli/pom.xml
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.flex.utilities.converter</groupId>
- <artifactId>apache-flex-sdk-converter</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>cli</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.4</version>
- <configuration>
- <archive>
- <manifest>
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
- <addClasspath>true</addClasspath>
- <mainClass>org.apache.flex.utilities.converter.core.SdkConverterCLI</mainClass>
- </manifest>
- <manifestEntries>
- <Implementation-Build>${project.version}</Implementation-Build>
- </manifestEntries>
- </archive>
- <descriptorRefs>
- <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>
- <finalName>apache-flex-sdk-converter-${project.version}</finalName>
- <appendAssemblyId>false</appendAssemblyId>
- </configuration>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.flex.utilities.converter</groupId>
- <artifactId>download-retriever</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.flex.utilities.converter</groupId>
- <artifactId>flex-converter</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.flex.utilities.converter</groupId>
- <artifactId>aether-deployer</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact</artifactId>
- <version>3.2.3</version>
- </dependency>
-
- <dependency>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- <version>1.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>3.3.2</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>1.7.7</version>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/mavenizer/cli/src/main/java/org/apache/flex/utilities/converter/core/SdkConverterCLI.java
----------------------------------------------------------------------
diff --git a/flex-maven-tools/mavenizer/cli/src/main/java/org/apache/flex/utilities/converter/core/SdkConverterCLI.java b/flex-maven-tools/mavenizer/cli/src/main/java/org/apache/flex/utilities/converter/core/SdkConverterCLI.java
deleted file mode 100644
index 918dd70..0000000
--- a/flex-maven-tools/mavenizer/cli/src/main/java/org/apache/flex/utilities/converter/core/SdkConverterCLI.java
+++ /dev/null
@@ -1,394 +0,0 @@
-package org.apache.flex.utilities.converter.core;
-
-import org.apache.commons.cli.*;
-import org.apache.commons.io.FileUtils;
-import org.apache.flex.utilities.converter.air.AirConverter;
-import org.apache.flex.utilities.converter.deployer.aether.AetherDeployer;
-import org.apache.flex.utilities.converter.flash.FlashConverter;
-import org.apache.flex.utilities.converter.flex.FlexConverter;
-import org.apache.flex.utilities.converter.fontkit.FontkitConverter;
-import org.apache.flex.utilities.converter.retrievers.download.DownloadRetriever;
-import org.apache.flex.utilities.converter.retrievers.types.PlatformType;
-import org.apache.flex.utilities.converter.retrievers.types.SdkType;
-import org.apache.flex.utilities.converter.wrapper.WrapperConverter;
-import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.*;
-
-/**
- * Created by christoferdutz on 07.04.15.
- */
-public class SdkConverterCLI {
-
- public static final String COMMAND_HELP = "help";
- public static final String COMMAND_LIST = "list";
- public static final String COMMAND_DOWNLOAD = "download";
- public static final String COMMAND_CONVERT = "convert";
- public static final String COMMAND_DEPLOY = "deploy";
-
- public static final String OPTION_FLEX_VERSION = "flexVersion";
- public static final String OPTION_FLASH_VERSIONS = "flashVersions";
- public static final String OPTION_AIT_VERSION = "airVersion";
- public static final String OPTION_FONTKIT = "fontkit";
- public static final String OPTION_PLATFORMS = "platforms";
-
- public static final String OPTION_FDK_DIR = "fdkDir";
- public static final String OPTION_MAVEN_DIR = "mavenDir";
-
- public static final String OPTION_REPO_URL = "repoUrl";
- public static final String OPTION_REPO_USERNAME = "repoUsername";
- public static final String OPTION_REPO_PASSWORD = "repoPassword";
-
-
- @SuppressWarnings("unchecked")
- public static void main(String[] args) throws Exception {
- Options options = new Options();
- options.addOption(OptionBuilder.withArgName("version").hasArg().
- withDescription("(Optional and Only valid for download) Version of the " +
- "FDK which should be downloaded.").
- isRequired(false).
- create(OPTION_FLEX_VERSION));
- options.addOption(OptionBuilder.withArgName("version(s)").hasArg().
- withValueSeparator(',').
- withDescription("(Optional and Only valid for download) Version(s) of the " +
- "Adobe Flash SDK which should be downloaded. Multiple versions can " +
- "be separated by \",\".").
- isRequired(false).
- create(OPTION_FLASH_VERSIONS));
- options.addOption(OptionBuilder.withArgName("version").hasArg().
- withDescription("(Optional and Only valid for download) Version of the " +
- "Adobe Air SDK which should be downloaded.").
- isRequired(false).
- create(OPTION_AIT_VERSION));
- options.addOption(OptionBuilder.
- withDescription("(Optional and Only valid for download) If provided, the " +
- "Converter will also download the Fontkit libraries needed for font " +
- "encoding.").
- isRequired(false).
- create(OPTION_FONTKIT));
- options.addOption(OptionBuilder.withArgName("platform(s)").hasArg().
- withValueSeparator(',').
- withDescription("(Optional and Only valid for download) Platform the artifacts " +
- "should be downloaded for. If omitted the platform this process is run " +
- "on will be used. Valid options are: \"WINDOWS\", \"MAC\" and \"LNX\". " +
- "Multiple versions can be separated by \",\".").
- isRequired(false).
- create(OPTION_PLATFORMS));
- options.addOption(OptionBuilder.withArgName("dir").hasArg().
- withDescription("(Optional) Directory that the FDK will be located in. " +
- "If omitted, a temporary directory will be used.").
- isRequired(false).
- create(OPTION_FDK_DIR));
- options.addOption(OptionBuilder.withArgName("dir").hasArg().
- withDescription("(Optional) Directory that the mavenized artifacts will be located in. " +
- "If omitted, a temporary directory will be used.").
- isRequired(false).
- create(OPTION_MAVEN_DIR));
- options.addOption(OptionBuilder.withArgName("url").hasArg().
- withDescription("(Optional and only valid for deploy) Url of the remote Maven " +
- "repository that the generated Maven artifacts should be deployed to.").
- isRequired(false).
- create(OPTION_REPO_URL));
- options.addOption(OptionBuilder.withArgName("username").hasArg().
- withDescription("(Optional and only valid for deploy) Username used to authenticate " +
- "on the remote Maven repository that the generated Maven artifacts should be " +
- "deployed to.").
- isRequired(false).
- create(OPTION_REPO_USERNAME));
- options.addOption(OptionBuilder.withArgName("password").hasArg().
- withDescription("(Optional and only valid for deploy) Password used to authenticate " +
- "on the remote Maven repository that the generated Maven artifacts should be " +
- "deployed to.").
- isRequired(false).
- create(OPTION_REPO_PASSWORD));
-
- CommandLineParser parser = new BasicParser();
- try {
- CommandLine cmd = parser.parse(options, args);
- if(cmd.getArgList().isEmpty() || cmd.getArgList().contains(COMMAND_HELP)) {
- printHelp(options);
- System.exit(0);
- }
-
- // Find out the desired platform(s).
- List<PlatformType> platforms = new ArrayList<PlatformType>();
- String platformParam = cmd.getOptionValue(OPTION_PLATFORMS);
- if((platformParam != null) && !platformParam.isEmpty()) {
- String[] platformNames = platformParam.split(",");
- for(String platformName : platformNames) {
- platforms.add(PlatformType.valueOf(platformName));
- }
- }
-
- if(platforms.isEmpty()) {
- try {
- platforms.add(PlatformType.getCurrent());
- } catch (Exception e) {
- System.err.println("Unsupported OS type. Provide manually using 'platform' parameter.");
- System.exit(1);
- }
- }
-
- /////////////////////////////////////////////////////////
- // Validate sensible combinations of commands.
- /////////////////////////////////////////////////////////
-
- // Check that all commands are valid.
- for(String command : (List<String>) cmd.getArgList()) {
- if(!COMMAND_LIST.equals(command) && !COMMAND_DOWNLOAD.equals(command) &&
- !COMMAND_CONVERT.equals(command) && !COMMAND_DEPLOY.equals(command)) {
- System.err.println("Unsupported command '" + command + "'.");
- System.exit(1);
- }
- }
-
- // Downloading and deploying without converting doesn't make sense.
- if(cmd.getArgList().contains(COMMAND_DOWNLOAD) && !cmd.getArgList().contains(COMMAND_CONVERT) &&
- cmd.getArgList().contains(COMMAND_DEPLOY)) {
- System.err.println("Downloading and deploying without conversion doesn't make much sense.");
- System.exit(1);
- }
-
- // If Downloading and not converting, the fdkDir parameter has to be provided as
- // otherwise the download result would reside in some strange temp directory.
- if(cmd.getArgList().contains(COMMAND_DOWNLOAD) && !cmd.getArgList().contains(COMMAND_CONVERT)
- && !cmd.hasOption(OPTION_FDK_DIR)) {
- System.err.println("Parameter 'fdkDir' required for task 'download' without conversion.");
- System.exit(1);
- }
-
- // If Converting and not deploying, the mavenDir parameter has to be provided as
- // otherwise the converted FDK would reside in some strange temp directory.
- if(cmd.getArgList().contains(COMMAND_CONVERT) && !cmd.getArgList().contains(COMMAND_DEPLOY)
- && !cmd.hasOption(OPTION_MAVEN_DIR)) {
- System.err.println("Parameter 'mavenDir' required for task 'convert' without deployment.");
- System.exit(1);
- }
-
- // Downloading nothing doesn't really make sense. On the bad side it even causes
- // problems with the converter without any fdkDir parameter, therefore we abort here.
- if(cmd.getArgList().contains(COMMAND_DOWNLOAD) && !cmd.hasOption(OPTION_FLEX_VERSION) &&
- !cmd.hasOption(OPTION_FLASH_VERSIONS) && !cmd.hasOption(OPTION_AIT_VERSION) &&
- !cmd.hasOption(OPTION_FONTKIT)) {
- System.err.println("At least one of the parameters 'flexVersion', 'flashVersions', 'airVersion' or " +
- "'fontkit' required for task 'download'.");
- System.exit(1);
- }
-
- // Find out where to download or convert from.
- File fdkDir = cmd.hasOption(OPTION_FDK_DIR) ?
- new File(cmd.getOptionValue(OPTION_FDK_DIR)) : getTempDir("FLEX-DOWNLOAD-");
-
- // Find out where to convert to or deploy from.
- File mavenDir = cmd.hasOption(OPTION_MAVEN_DIR) ?
- new File(cmd.getOptionValue(OPTION_MAVEN_DIR)) : getTempDir("FLEX-MAVEN-");
-
- ////////////////////////////////////////////////////////////////////////////
- // Exectute operations
- ////////////////////////////////////////////////////////////////////////////
-
- // Output a list of all available downloads.
- if(cmd.getArgList().contains(COMMAND_LIST)) {
- System.out.println("-----------------------------------------------");
- System.out.println("- Available downloads");
- System.out.println("-----------------------------------------------");
-
- DownloadRetriever retriever = new DownloadRetriever();
- System.out.println("Apache Flex:");
- List<DefaultArtifactVersion> versions = new ArrayList<DefaultArtifactVersion>(
- retriever.getAvailableVersions(SdkType.FLEX).keySet());
- Collections.sort(versions);
- for(DefaultArtifactVersion version : versions) {
- System.out.println(" - " + version.toString());
- }
- System.out.println();
-
- System.out.println("Adobe Flash:");
- versions = new ArrayList<DefaultArtifactVersion>(
- retriever.getAvailableVersions(SdkType.FLASH).keySet());
- Collections.sort(versions);
- for(DefaultArtifactVersion version : versions) {
- System.out.println(" - " + version.toString());
- }
- System.out.println();
-
- System.out.println("Adobe AIR:");
- Map<DefaultArtifactVersion, Collection<PlatformType>> versionData =
- retriever.getAvailableVersions(SdkType.AIR);
- versions = new ArrayList<DefaultArtifactVersion>(versionData.keySet());
- Collections.sort(versions);
- for(DefaultArtifactVersion version : versions) {
- StringBuilder sb = new StringBuilder();
- sb.append(" - ").append(version.toString()).append(" (");
- boolean firstOption = true;
- for(PlatformType platformType : versionData.get(version)) {
- if(!firstOption) {
- sb.append(", ");
- }
- sb.append(platformType.name());
- firstOption = false;
- }
- sb.append(")");
- System.out.println(sb.toString());
- }
- }
-
- // Handle the downloading of atifacts.
- if(cmd.getArgList().contains(COMMAND_DOWNLOAD)) {
- System.out.println("-----------------------------------------------");
- System.out.println("- Downloading");
- System.out.println("-----------------------------------------------");
-
- DownloadRetriever retriever = new DownloadRetriever();
-
- String flexVersion = cmd.getOptionValue(OPTION_FLEX_VERSION, null);
- if(flexVersion != null) {
- System.out.println("- Downloading Flex SDK version: " + flexVersion +
- " to directory: " + fdkDir.getAbsolutePath());
- File fdkDownloadDirectory = retriever.retrieve(SdkType.FLEX, flexVersion);
- // Unpack the archive to the FDK directory.
- mergeDirectories(fdkDownloadDirectory, fdkDir);
-
- // Add the swfobject files.
- File swfObjectDirectory = retriever.retrieve(SdkType.SWFOBJECT);
- mergeDirectories(swfObjectDirectory, fdkDir);
- }
-
- String flashVersions = cmd.getOptionValue(OPTION_FLASH_VERSIONS, "");
- if(!flashVersions.isEmpty()) {
- for(String flashVersion : flashVersions.split(",")) {
- System.out.println("- Downloading Flash SDK version: " + flashVersion +
- " to directory: " + fdkDir.getAbsolutePath());
- File flashDownloadDiretory = retriever.retrieve(SdkType.FLASH, flashVersion);
- // Integrate the download into the FDK directory.
- mergeDirectories(flashDownloadDiretory, fdkDir);
- }
- }
-
- String airVersion = cmd.getOptionValue(OPTION_AIT_VERSION, "");
- if(!airVersion.isEmpty()) {
- for(PlatformType platformType : platforms) {
- System.out.println("- Downloading Air SDK version: " + airVersion +
- " and platform " + platformType.name() +
- " to directory: " + fdkDir.getAbsolutePath());
- File airDownloadDirectory = retriever.retrieve(SdkType.AIR, airVersion, platformType);
- // Integrate the download into the FDK directory.
- mergeDirectories(airDownloadDirectory, fdkDir);
- }
- }
-
- if(cmd.hasOption(OPTION_FONTKIT)) {
- System.out.println("- Downloading Flex Fontkit libraries" +
- " to directory: " + fdkDir.getAbsolutePath());
- File fontkitDownloadDirectory = retriever.retrieve(SdkType.FONTKIT);
- // Integrate the download into the FDK directory.
- mergeDirectories(fontkitDownloadDirectory, fdkDir);
- }
-
- System.out.println("Finished downloads.");
- }
-
- // Handle the conversion.
- if(cmd.getArgList().contains(COMMAND_CONVERT)) {
- System.out.println("-----------------------------------------------");
- System.out.println("- Conversion");
- System.out.println("-----------------------------------------------");
-
- System.out.println("- Converting Flex SDK from " + fdkDir.getAbsolutePath() +
- " to " + mavenDir.getAbsolutePath());
- FlexConverter flexConverter = new FlexConverter(fdkDir, mavenDir);
- flexConverter.convert();
-
- System.out.println("- Converting Flash SDKs from " + fdkDir.getAbsolutePath() +
- " to " + mavenDir.getAbsolutePath());
- FlashConverter flashConverter = new FlashConverter(fdkDir, mavenDir);
- flashConverter.convert();
-
- System.out.println("- Converting Air SDK from " + fdkDir.getAbsolutePath() +
- " to " + mavenDir.getAbsolutePath());
- AirConverter airConverter = new AirConverter(fdkDir, mavenDir);
- airConverter.convert();
-
- System.out.println("- Converting Fontkit libraries from " + fdkDir.getAbsolutePath() +
- " to " + mavenDir.getAbsolutePath());
- FontkitConverter fontkitConverter = new FontkitConverter(fdkDir, mavenDir);
- fontkitConverter.convert();
-
- System.out.println("- Converting Wrappers from " + fdkDir.getAbsolutePath() +
- " to " + mavenDir.getAbsolutePath());
- WrapperConverter wrapperConverter = new WrapperConverter(fdkDir, mavenDir);
- wrapperConverter.convert();
-
- System.out.println("Finished conversion.");
- }
-
- // Handle the deployment.
- if(cmd.getArgList().contains(COMMAND_DEPLOY)) {
- System.out.println("-----------------------------------------------");
- System.out.println("- Deployment");
- System.out.println("-----------------------------------------------");
-
- if(!cmd.hasOption(OPTION_REPO_URL)) {
- System.err.println("Parameter 'repoUrl' required for task 'deploy'.");
- System.exit(1);
- }
-
- String repoUrl = cmd.getOptionValue(OPTION_REPO_URL);
- String repoUsername = cmd.getOptionValue(OPTION_REPO_USERNAME, null);
- String repoPassword = cmd.getOptionValue(OPTION_REPO_PASSWORD, null);
-
- System.out.println("- Deploying libraries to " + repoUrl + " from " + mavenDir.getAbsolutePath());
-
- AetherDeployer deployer = new AetherDeployer(mavenDir, repoUrl, repoUsername, repoPassword);
- deployer.deploy();
-
- System.out.println("Finished deploying.");
- }
- System.out.println("-----------------------------------------------");
- } catch (ParseException e) {
- System.err.println("Parsing failed. Reason: " + e.getMessage());
- printHelp(options);
- }
- }
-
- protected static void printHelp(Options options) {
- String headerText = "Commands: \n" +
- "If the parameters 'fdkDir' and 'mavenDir' are not specified, the Converter creates two temporary " +
- "directories in your systems temp directory and uses these for the follwoing commands.\n" +
- " - list:\nList all available versions and platforms (for download)\n" +
- " - download:\nDownload the selected versions of FDK parts specified by 'flexVersion', " +
- "'flashVersions', 'airVersion' and 'fontkit' and creates an FDK in the directory specified by " +
- "'fdkDir'. If 'airVersion' is specified, the 'platforms' parameter specifies the platforms for which " +
- "the given AIR SDK should be downloaded, if not specified the current systems platform is used. \n" +
- " - convert:\nConvert the FDK located in 'fdkDir' into a mavenized form at 'mavenDir'.\n" +
- " - deploy:\nDeploy the maven artifacts located in 'mavenDir', to the remote maven repository " +
- "specified with 'repoUrl'. If the 'repoUsername' and 'repoPassword' parameters are specified, use " +
- "these credentials for authenticating at the remote system.\n" +
- "Options:";
-
- HelpFormatter helpFormatter = new HelpFormatter();
- helpFormatter.printHelp("java -jar apache-flex-sdk-converter.jar [list] [-fdkDir <fdkDir>] " +
- "[-mavenDir <mavenDir>] [[-flexVersion <version>] [-flashVersions <version(s)>] " +
- "[-airVersion <version> [-platforms <platform(s)>]] [-fontkit] download] [convert] " +
- "[-repoUrl <url> [-repoUsername <username> -repoPassword <password>] deploy]",
- headerText, options, "");
- }
-
- protected static File getTempDir(String prefix) throws IOException {
- File tempFile = File.createTempFile(prefix, ".TMP");
- tempFile.delete();
- File tempDir = new File(tempFile.getParentFile(),
- tempFile.getName().substring(0, tempFile.getName().length() - 4));
- if(!tempDir.exists()) {
- tempDir.mkdirs();
- }
- return tempDir;
- }
-
- protected static void mergeDirectories(File sourceDir, File targetDir) throws IOException {
- FileUtils.copyDirectory(sourceDir, targetDir);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/mavenizer/converters/air/pom.xml
----------------------------------------------------------------------
diff --git a/flex-maven-tools/mavenizer/converters/air/pom.xml b/flex-maven-tools/mavenizer/converters/air/pom.xml
deleted file mode 100644
index 88d61aa..0000000
--- a/flex-maven-tools/mavenizer/converters/air/pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.flex.utilities.converter</groupId>
- <artifactId>converters</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>air-converter</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.flex.utilities.converter</groupId>
- <artifactId>base-converter</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/mavenizer/converters/air/src/main/java/org/apache/flex/utilities/converter/air/AirConverter.java
----------------------------------------------------------------------
diff --git a/flex-maven-tools/mavenizer/converters/air/src/main/java/org/apache/flex/utilities/converter/air/AirConverter.java b/flex-maven-tools/mavenizer/converters/air/src/main/java/org/apache/flex/utilities/converter/air/AirConverter.java
deleted file mode 100644
index 1c32f05..0000000
--- a/flex-maven-tools/mavenizer/converters/air/src/main/java/org/apache/flex/utilities/converter/air/AirConverter.java
+++ /dev/null
@@ -1,431 +0,0 @@
-/*
- * 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 org.apache.flex.utilities.converter.air;
-
-import org.apache.flex.utilities.converter.BaseConverter;
-import org.apache.flex.utilities.converter.Converter;
-import org.apache.flex.utilities.converter.exceptions.ConverterException;
-import org.apache.flex.utilities.converter.model.MavenArtifact;
-
-import java.io.*;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.zip.ZipOutputStream;
-
-/**
- * Created by cdutz on 22.04.2014.
- */
-public class AirConverter extends BaseConverter implements Converter {
-
- protected String airSdkVersion;
-
- /**
- * @param rootSourceDirectory Path to the root of the original AIR SDK.
- * @param rootTargetDirectory Path to the root of the directory where the Maven artifacts should be generated to.
- * @throws ConverterException
- */
- public AirConverter(File rootSourceDirectory, File rootTargetDirectory) throws ConverterException {
- super(rootSourceDirectory, rootTargetDirectory);
-
- // Get the version of the current air sdk.
- this.airSdkVersion = getAirVersion(rootSourceDirectory);
- }
-
- /**
- * Entry point for generating the Maven artifacts for an AIR SDK.
- *
- * @throws ConverterException
- */
- @Override
- protected void processDirectory() throws ConverterException {
- if ((airSdkVersion == null) || !rootSourceDirectory.exists() || !rootSourceDirectory.isDirectory()) {
- System.out.println("Skipping AIR SDK generation.");
- return;
- }
-
- generateCompilerArtifacts();
- generateRuntimeArtifacts();
- generateFrameworkArtifacts();
- }
-
- /**
- * This method generates those artifacts that resemble the compiler part of the AIR SDK.
- *
- * @throws ConverterException
- */
- protected void generateCompilerArtifacts() throws ConverterException {
- // Create the root artifact.
- final MavenArtifact compiler = new MavenArtifact();
- compiler.setGroupId("com.adobe.air");
- compiler.setArtifactId("compiler");
- compiler.setVersion(airSdkVersion);
- compiler.setPackaging("pom");
-
- // Create a list of all libs that should belong to the AIR SDK compiler.
- final File directory = new File(rootSourceDirectory, "lib");
- if (!directory.exists() || !directory.isDirectory()) {
- throw new ConverterException("Compiler directory does not exist.");
- }
- final List<File> files = new ArrayList<File>();
- files.addAll(Arrays.asList(directory.listFiles(new AirCompilerFilter())));
-
- // Add the smali.jar and baksmali.jar from the android/lib directory
- // as this is needed for Android packaging.
- File androidDir = new File(directory, "android");
- if (androidDir.exists() && androidDir.isDirectory()) {
- File androidLibDir = new File(androidDir, "lib");
- if (androidLibDir.exists() && androidLibDir.isDirectory()) {
- files.addAll(Arrays.asList(androidLibDir.listFiles(new AirCompilerFilter())));
- }
- }
-
- // Generate artifacts for every jar in the input directories.
- for (final File sourceFile : files) {
- final MavenArtifact artifact = resolveArtifact(sourceFile, "com.adobe.air.compiler", airSdkVersion);
- compiler.addDependency(artifact);
- }
-
- // Generate the android package (android directory)
- if (androidDir.exists() && androidDir.isDirectory()) {
- final File androidZip = new File(rootTargetDirectory,
- "com.adobe.air.compiler.adt.".replace(".", File.separator) + airSdkVersion +
- File.separator + "adt-" + airSdkVersion + "-android.zip");
- try {
- // Add all the content to a zip-file.
- final ZipOutputStream zipOutputStream = new ZipOutputStream(new FileOutputStream(androidZip));
- // Package all the compiler parts.
- File[] zipfiles = androidDir.listFiles();
- if(zipfiles != null) {
- for (final File file : zipfiles) {
- addFileToZip(zipOutputStream, file, rootSourceDirectory);
- }
- }
- // Package all the runtime parts.
- File runtimesDir = new File(rootSourceDirectory, "runtimes/air/android");
- if(runtimesDir.exists() && runtimesDir.isDirectory()) {
- zipfiles = runtimesDir.listFiles();
- if (zipfiles != null) {
- for (final File file : zipfiles) {
- addFileToZip(zipOutputStream, file, rootSourceDirectory);
- }
- }
- }
- File binDir = new File(rootSourceDirectory, "bin");
- if(binDir.exists() && binDir.isDirectory()) {
- zipfiles = binDir.listFiles(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return name.equals("adt") || name.equals("adt.bat") ||
- name.equals("adl") || name.equals("adl.exe");
- }
- });
- if (zipfiles != null) {
- for (final File file : zipfiles) {
- addFileToZip(zipOutputStream, file, rootSourceDirectory);
- }
- }
- }
- zipOutputStream.close();
- } catch(IOException e) {
- throw new ConverterException("Error generating android package zip.", e);
- }
- }
-
- // Generate the ios package (aot directory)
- File iosDir = new File(directory, "aot");
- if (iosDir.exists() && iosDir.isDirectory()) {
- final File iosZip = new File(rootTargetDirectory,
- "com.adobe.air.compiler.adt.".replace(".", File.separator) + airSdkVersion +
- File.separator + "adt-" + airSdkVersion + "-ios.zip");
- try {
- // Add all the content to a zip-file.
- final ZipOutputStream zipOutputStream = new ZipOutputStream(new FileOutputStream(iosZip));
- // Package all the compiler parts.
- File[] zipfiles = iosDir.listFiles();
- if(zipfiles != null) {
- for (final File file : zipfiles) {
- addFileToZip(zipOutputStream, file, rootSourceDirectory);
- }
- }
- File binDir = new File(rootSourceDirectory, "bin");
- if(binDir.exists() && binDir.isDirectory()) {
- zipfiles = binDir.listFiles(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return name.equals("adt") || name.equals("adt.bat") ||
- name.equals("adl") || name.equals("adl.exe");
- }
- });
- if (zipfiles != null) {
- for (final File file : zipfiles) {
- addFileToZip(zipOutputStream, file, rootSourceDirectory);
- }
- }
- }
- zipOutputStream.close();
- } catch(IOException e) {
- throw new ConverterException("Error generating android package zip.", e);
- }
- }
-
- // Generate the exe, dmg, deb, rpm packages (nai directory)
- File desktopDir = new File(directory, "nai");
- if (desktopDir.exists() && desktopDir.isDirectory()) {
- final File desktopZip = new File(rootTargetDirectory,
- "com.adobe.air.compiler.adt.".replace(".", File.separator) + airSdkVersion +
- File.separator + "adt-" + airSdkVersion + "-desktop.zip");
- try {
- // Add all the content to a zip-file.
- final ZipOutputStream zipOutputStream = new ZipOutputStream(new FileOutputStream(desktopZip));
- // Package all the compiler parts.
- File[] zipfiles = desktopDir.listFiles();
- if(zipfiles != null) {
- for (final File file : zipfiles) {
- addFileToZip(zipOutputStream, file, rootSourceDirectory);
- }
- }
- // Package all the runtime parts.
- File runtimesDir = new File(rootSourceDirectory, "runtimes/air/win");
- if(runtimesDir.exists() && runtimesDir.isDirectory()) {
- zipfiles = runtimesDir.listFiles();
- if (zipfiles != null) {
- for (final File file : zipfiles) {
- addFileToZip(zipOutputStream, file, rootSourceDirectory);
- }
- }
- }
- runtimesDir = new File(rootSourceDirectory, "runtimes/air/mac/Adobe AIR.framework/Versions/1.0");
- if(runtimesDir.exists() && runtimesDir.isDirectory()) {
- zipfiles = runtimesDir.listFiles();
- if (zipfiles != null) {
- for (final File file : zipfiles) {
- addFileToZip(zipOutputStream, file, rootSourceDirectory);
- }
- }
- }
- runtimesDir = new File(rootSourceDirectory, "runtimes/air-captive/win");
- if(runtimesDir.exists() && runtimesDir.isDirectory()) {
- zipfiles = runtimesDir.listFiles();
- if (zipfiles != null) {
- for (final File file : zipfiles) {
- addFileToZip(zipOutputStream, file, rootSourceDirectory);
- }
- }
- }
- runtimesDir = new File(rootSourceDirectory, "runtimes/air-captive/mac/Adobe AIR.framework/Versions/1.0");
- if(runtimesDir.exists() && runtimesDir.isDirectory()) {
- zipfiles = runtimesDir.listFiles();
- if (zipfiles != null) {
- for (final File file : zipfiles) {
- addFileToZip(zipOutputStream, file, rootSourceDirectory);
- }
- }
- }
- File binDir = new File(rootSourceDirectory, "bin");
- if(binDir.exists() && binDir.isDirectory()) {
- zipfiles = binDir.listFiles(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return name.equals("adt") || name.equals("adt.bat") ||
- name.equals("adl") || name.equals("adl.exe");
- }
- });
- if (zipfiles != null) {
- for (final File file : zipfiles) {
- addFileToZip(zipOutputStream, file, rootSourceDirectory);
- }
- }
- }
- zipOutputStream.close();
- } catch(IOException e) {
- throw new ConverterException("Error generating android package zip.", e);
- }
- }
-
- // Write this artifact to file.
- writeArtifact(compiler);
- }
-
- /**
- * This method generates those artifacts that resemble the runtime part of the AIR SDK.
- *
- * @throws ConverterException
- */
- protected void generateRuntimeArtifacts() throws ConverterException {
- // Create the root artifact.
- final MavenArtifact runtime = new MavenArtifact();
- runtime.setGroupId("com.adobe.air");
- runtime.setArtifactId("runtime");
- runtime.setVersion(airSdkVersion);
- runtime.setPackaging("pom");
-
- // Create a list of all libs that should belong to the AIR SDK runtime.
- final File directory = new File(rootSourceDirectory, "bin");
- if (!directory.exists() || !directory.isDirectory()) {
- throw new ConverterException("Runtime directory does not exist.");
- }
- final List<File> files = new ArrayList<File>();
- files.addAll(Arrays.asList(directory.listFiles(new AirRuntimeFilter())));
-
- // Generate artifacts for every jar in the input directories (Actually this is only one file).
- for (final File sourceFile : files) {
- final MavenArtifact artifact = resolveArtifact(sourceFile, "com.adobe.air.runtime", airSdkVersion);
- runtime.addDependency(artifact);
- }
-
- // Zip up the AIR runtime directory.
- final MavenArtifact airRuntimeArtifact = generateAirRuntimeArtifact(rootSourceDirectory);
- if (airRuntimeArtifact != null) {
- runtime.addDependency(airRuntimeArtifact);
- }
-
- // Write this artifact to file.
- writeArtifact(runtime);
- }
-
- /**
- * This method generates those artifacts that resemble the framework part of the AIR SDK.
- *
- * @throws ConverterException
- */
- protected void generateFrameworkArtifacts() throws ConverterException {
- // Create the root artifact.
- final MavenArtifact framework = new MavenArtifact();
- framework.setGroupId("com.adobe.air");
- framework.setArtifactId("framework");
- framework.setVersion(airSdkVersion);
- framework.setPackaging("pom");
-
- // Create a list of all libs that should belong to the AIR SDK framework.
- final File directory =
- new File(rootSourceDirectory, "frameworks" + File.separator + "libs" + File.separator + "air");
- if (!directory.exists() || !directory.isDirectory()) {
- throw new ConverterException("Framework directory does not exist.");
- }
- final List<File> files = new ArrayList<File>();
- files.addAll(Arrays.asList(directory.listFiles(new AirFrameworkFilter())));
-
- // Generate artifacts for every jar in the input directories.
- for (final File sourceFile : files) {
- final MavenArtifact artifact = resolveArtifact(sourceFile, "com.adobe.air.framework", airSdkVersion);
- framework.addDependency(artifact);
- }
-
- // Write this artifact to file.
- writeArtifact(framework);
- }
-
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- //
- // Utility methods
- //
- ///////////////////////////////////////////////////////////////////////////////////////////////////
-
- protected MavenArtifact generateAirRuntimeArtifact(File rootDirectory) throws ConverterException {
- final MavenArtifact airRuntimeArtifact = new MavenArtifact();
- airRuntimeArtifact.setGroupId("com.adobe.air.runtime");
- airRuntimeArtifact.setArtifactId("air-runtime");
- airRuntimeArtifact.setVersion(airSdkVersion);
- airRuntimeArtifact.setPackaging("zip");
-
- final File runtimeRoot = new File(rootDirectory, "runtimes.air".replace(".", File.separator));
- final File[] platforms = runtimeRoot.listFiles();
- if (platforms != null) {
- for (final File platform : platforms) {
- if (!platform.isDirectory()) {
- continue;
- }
- final String platformName = platform.getName();
- try {
- final File zip = File.createTempFile("AirRuntime-" + platformName + "-" + airSdkVersion, "zip");
- generateZip(platform.listFiles(), zip);
- airRuntimeArtifact.addBinaryArtifact(platformName, zip);
- } catch (IOException e) {
- throw new ConverterException("Error creating runtime zip.", e);
- }
- }
- } else {
- return null;
- }
-
- writeArtifact(airRuntimeArtifact);
- return airRuntimeArtifact;
- }
-
- /**
- * Get the version of an AIR SDK from the content of the SDK directory.
- *
- * @return version string for the current AIR SDK
- */
- protected String getAirVersion(File rootDirectory) throws ConverterException {
- // All AIR SDKs contain a text file "AIR SDK Readme.txt" which contains a
- // Version string in the first line. Newer SDKs contain an additional "airsdk.xml"
- // which would be easier to parse, but as all SDKs contain the text-file, we'll
- // stick to that for now.
-
- final File sdkDescriptor = new File(rootDirectory, "AIR SDK Readme.txt");
-
- // If the descriptor is not present, return null as this FDK directory doesn't
- // seem to contain a AIR SDK.
- if (!sdkDescriptor.exists() || !sdkDescriptor.isFile()) {
- return null;
- }
-
- DataInputStream in = null;
- try {
- final FileInputStream descriptorInputStream = new FileInputStream(sdkDescriptor);
- in = new DataInputStream(descriptorInputStream);
- final BufferedReader br = new BufferedReader(new InputStreamReader(in));
- final String strLine = br.readLine();
- return strLine.substring("Adobe AIR ".length(), strLine.indexOf(" ", "Adobe AIR ".length()));
- } catch (Exception e) {
- throw new ConverterException("Error getting AIR version.", e);
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException ioe) {
- // Ignore.
- }
- }
- }
- }
-
- public static class AirCompilerFilter implements FilenameFilter {
- public boolean accept(File dir, String name) {
- return name.equals("adt.jar") || name.equals("smali.jar") || name.equals("baksmali.jar");
- }
- }
-
- public static class AirRuntimeFilter implements FilenameFilter {
- public boolean accept(File dir, String name) {
- return name.equalsIgnoreCase("adl.exe");
- }
- }
-
- public static class AirFrameworkFilter implements FilenameFilter {
- public boolean accept(File dir, String name) {
- return name.equals("aircore.swc") || name.equals("airglobal.swc") ||
- name.equals("applicationupdater.swc") || name.equals("applicationupdater_ui.swc") ||
- name.equals("servicemonitor.swc");
- }
- }
-
- public static void main(String[] args) throws Exception {
- AirConverter converter = new AirConverter(new File(args[0]), new File(args[1]));
- converter.convert();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/8bc0350d/flex-maven-tools/mavenizer/converters/base/pom.xml
----------------------------------------------------------------------
diff --git a/flex-maven-tools/mavenizer/converters/base/pom.xml b/flex-maven-tools/mavenizer/converters/base/pom.xml
deleted file mode 100644
index 5a1b89c..0000000
--- a/flex-maven-tools/mavenizer/converters/base/pom.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.flex.utilities.converter</groupId>
- <artifactId>converters</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>base-converter</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <dependencies>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-client</artifactId>
- <version>1.12</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.jettison</groupId>
- <artifactId>jettison</artifactId>
- <version>1.3.1</version>
- </dependency>
- <dependency>
- <groupId>org.freemarker</groupId>
- <artifactId>freemarker</artifactId>
- <version>2.3.22</version>
- </dependency>
- </dependencies>
-
-</project>