Skip to content
Permalink
Browse files
- Created some dummy implementations of the 4 compiler components
- Implemented a version of the compiler mojo, which is able to use the different compiler implementations, depending on the current execution phase and a "useLegacyCompiler" configuration option

git-svn-id: https://svn.apache.org/repos/asf/incubator/flex/utilities/trunk@1416169 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
chrisdutz committed Dec 2, 2012
1 parent 9720785 commit ddaa57090b58eec869f05c058e786245aaa22cf6
Showing 13 changed files with 355 additions and 2 deletions.
@@ -24,6 +24,6 @@
*/
public interface Compiler {

boolean compatible();
void compile();

}
@@ -36,12 +36,41 @@

<name>Maven-Flex-Plugin / Components / Compiler / ASDoc</name>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-metadata</artifactId>
<version>1.5.5</version>
<executions>
<execution>
<id>process-classes</id>
<goals>
<goal>generate-metadata</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.apache.flex.components</groupId>
<artifactId>api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.2</version>
<scope>compile</scope>
</dependency>
</dependencies>

</project>
@@ -0,0 +1,40 @@
/*
* 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.maven.plugins.flex.compiler.asdoc;

import org.apache.flex.maven.plugins.flex.compiler.Compiler;
import org.codehaus.plexus.component.annotations.Component;

/**
* Created with IntelliJ IDEA.
* User: cdutz
* Date: 02.12.12
* Time: 12:40
*/
@Component(role = Compiler.class, hint = "asdoc")
public class AsdocCompilerImpl implements Compiler {

public AsdocCompilerImpl() {
System.out.println("Compiler Instance Created: Asdoc");
}

@Override
public void compile() {
System.out.println("Executing Compiler: Asdoc");
}

}
@@ -36,12 +36,41 @@

<name>Maven-Flex-Plugin / Components / Compiler / Compc</name>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-metadata</artifactId>
<version>1.5.5</version>
<executions>
<execution>
<id>process-classes</id>
<goals>
<goal>generate-metadata</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.apache.flex.components</groupId>
<artifactId>api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.2</version>
<scope>compile</scope>
</dependency>
</dependencies>

</project>
@@ -0,0 +1,40 @@
/*
* 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.maven.plugins.flex.compiler.compc;

import org.apache.flex.maven.plugins.flex.compiler.Compiler;
import org.codehaus.plexus.component.annotations.Component;

/**
* Created with IntelliJ IDEA.
* User: cdutz
* Date: 02.12.12
* Time: 12:40
*/
@Component(role = Compiler.class, hint = "compc")
public class CompcCompilerImpl implements Compiler {

public CompcCompilerImpl() {
System.out.println("Compiler Instance Created: Compc");
}

@Override
public void compile() {
System.out.println("Executing Compiler: Compc");
}

}
@@ -36,12 +36,41 @@

<name>Maven-Flex-Plugin / Components / Compiler / Falcon</name>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-metadata</artifactId>
<version>1.5.5</version>
<executions>
<execution>
<id>process-classes</id>
<goals>
<goal>generate-metadata</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.apache.flex.components</groupId>
<artifactId>api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.2</version>
<scope>compile</scope>
</dependency>
</dependencies>

</project>
@@ -0,0 +1,40 @@
/*
* 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.maven.plugins.flex.compiler.falcon;

import org.apache.flex.maven.plugins.flex.compiler.Compiler;
import org.codehaus.plexus.component.annotations.Component;

/**
* Created with IntelliJ IDEA.
* User: cdutz
* Date: 02.12.12
* Time: 12:40
*/
@Component(role = Compiler.class, hint = "falcon")
public class FalconCompilerImpl implements Compiler {

public FalconCompilerImpl() {
System.out.println("Compiler Instance Created: Falcon");
}

@Override
public void compile() {
System.out.println("Executing Compiler: Falcon");
}

}
@@ -36,12 +36,41 @@

<name>Maven-Flex-Plugin / Components / Compiler / MXMLC</name>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-metadata</artifactId>
<version>1.5.5</version>
<executions>
<execution>
<id>process-classes</id>
<goals>
<goal>generate-metadata</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.apache.flex.components</groupId>
<artifactId>api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.2</version>
<scope>compile</scope>
</dependency>
</dependencies>

</project>
@@ -0,0 +1,40 @@
/*
* 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.maven.plugins.flex.compiler.mxmlc;

import org.apache.flex.maven.plugins.flex.compiler.Compiler;
import org.codehaus.plexus.component.annotations.Component;

/**
* Created with IntelliJ IDEA.
* User: cdutz
* Date: 02.12.12
* Time: 12:40
*/
@Component(role = Compiler.class, hint = "mxmlc")
public class MxmlcCompilerImpl implements Compiler {

public MxmlcCompilerImpl() {
System.out.println("Compiler Instance Created: MXMLC");
}

@Override
public void compile() {
System.out.println("Executing Compiler: MXMLC");
}

}
@@ -66,6 +66,11 @@
<artifactId>maven-plugin-api</artifactId>
<version>3.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
@@ -77,6 +82,27 @@
<artifactId>api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- Compiler implementations -->
<dependency>
<groupId>org.apache.flex.components</groupId>
<artifactId>compiler-falcon</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.flex.components</groupId>
<artifactId>compiler-mxmlc</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.flex.components</groupId>
<artifactId>compiler-compc</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.flex.components</groupId>
<artifactId>compiler-asdoc</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

</project>

0 comments on commit ddaa570

Please sign in to comment.