Skip to content

Commit

Permalink
maven maintenance (MobiVM#395)
Browse files Browse the repository at this point in the history
* * cosmetic: fixed pom.xml in templates to use java 1.8 and proper mobivm dependencies. cosmetic as these files are not included when building

* Maven maintenance-fixes:
- `ios-device` mojo now uses `arm64` as default architecture (similar to gradle plugin) to minimize amount of error happened to new users when running on arm64 only devices
- all pojos now explicitly calls `compile` goal (similar to gradle plugin). just to eliminate `Failed to launch IOS Simulator: Main class xxx.Main not found` error for new users
- idea: mvn template fixed to use proper MobiVm dependencies (as it was still using org.robovm as result it was failing to sync)
- idea: mvn template updated to use 1.8 java, otherwise it was failing to compile 'ios app without storyboard' as it uses lambdas
- idea: default app name renamed from `My App` -> `MyApp` as space was breaking maven build (space is not allowed in artifactId).
  • Loading branch information
dkimitsa authored and Tom-Ski committed Jul 10, 2019
1 parent 2bcbe91 commit 3087632
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ private void applyTemplate(Project project, Module module, VirtualFile contentRo
}
}
} else if (buildSystem == BuildSystem.Maven) {
String template = IOUtils.toString(RoboVmModuleBuilder.class.getResource("/pom.xml"), "UTF-8");
String template = IOUtils.toString(RoboVmModuleBuilder.class.getResource("/template_pom.xml"), "UTF-8");
template = template.replaceAll(ROBOVM_VERSION_PLACEHOLDER, Version.getVersion());
template = template.replaceAll(PACKAGE_NAME_PLACEHOLDER, packageName);
template = template.replaceAll(APP_NAME_PLACEHOLDER, appName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
</grid>
</constraints>
<properties>
<text value="My App"/>
<text value="MyApp"/>
</properties>
</component>
<component id="38f5a" class="javax.swing.JTextField" binding="appId">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

<dependencies>
<dependency>
<groupId>org.robovm</groupId>
<groupId>com.mobidevelop.robovm</groupId>
<artifactId>robovm-rt</artifactId>
<version>${robovm.version}</version>
</dependency>
<dependency>
<groupId>org.robovm</groupId>
<groupId>com.mobidevelop.robovm</groupId>
<artifactId>robovm-cocoatouch</artifactId>
<version>${robovm.version}</version>
</dependency>
Expand All @@ -36,12 +36,12 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.robovm</groupId>
<groupId>com.mobidevelop.robovm</groupId>
<artifactId>robovm-maven-plugin</artifactId>
<version>${robovm.version}</version>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.archiver.UnArchiver;
Expand All @@ -56,6 +58,7 @@

/**
*/
@Execute(goal="compile", phase = LifecyclePhase.COMPILE)
public abstract class AbstractRoboVMMojo extends AbstractMojo {

@Component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public void execute() throws MojoExecutionException, MojoFailureException {

try {

Arch arch = Arch.thumbv7;
if (super.arch != null && super.arch.equals(Arch.arm64.toString())) {
arch = Arch.arm64;
Arch arch = Arch.arm64;
if (super.arch != null && super.arch.equals(Arch.thumbv7.toString())) {
arch = Arch.thumbv7;
}

AppCompiler compiler = build(OS.ios, arch, IOSTarget.TYPE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<packaging>jar</packaging>

<properties>
<robovm.version>1.14.0</robovm.version>
<robovm.maven.version>1.14.0</robovm.maven.version>
<robovm.version>2.3.7</robovm.version>
<robovm.maven.version>2.3.7</robovm.maven.version>
</properties>

<version>${version}</version>
Expand All @@ -23,12 +23,12 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.robovm</groupId>
<groupId>com.mobidevelop.robovm</groupId>
<artifactId>robovm-maven-plugin</artifactId>
<version>${robovm.maven.version}</version>
</plugin>
Expand All @@ -38,7 +38,7 @@

<dependencies>
<dependency>
<groupId>org.robovm</groupId>
<groupId>com.mobidevelop.robovm</groupId>
<artifactId>robovm-rt</artifactId>
<version>${robovm.version}</version>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<packaging>jar</packaging>

<properties>
<robovm.version>1.14.0</robovm.version>
<robovm.maven.version>1.14.0</robovm.maven.version>
<robovm.version>2.3.7</robovm.version>
<robovm.maven.version>2.3.7</robovm.maven.version>
</properties>

<version>${version}</version>
Expand All @@ -23,12 +23,12 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.robovm</groupId>
<groupId>com.mobidevelop.robovm</groupId>
<artifactId>robovm-maven-plugin</artifactId>
<version>${robovm.maven.version}</version>
</plugin>
Expand All @@ -38,12 +38,12 @@

<dependencies>
<dependency>
<groupId>org.robovm</groupId>
<groupId>com.mobidevelop.robovm</groupId>
<artifactId>robovm-rt</artifactId>
<version>${robovm.version}</version>
</dependency>
<dependency>
<groupId>org.robovm</groupId>
<groupId>com.mobidevelop.robovm</groupId>
<artifactId>robovm-cocoatouch</artifactId>
<version>${robovm.version}</version>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<packaging>jar</packaging>

<properties>
<robovm.version>1.14.0</robovm.version>
<robovm.maven.version>1.14.0</robovm.maven.version>
<robovm.version>2.3.7</robovm.version>
<robovm.maven.version>2.3.7</robovm.maven.version>
</properties>

<version>${version}</version>
Expand All @@ -23,12 +23,12 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.robovm</groupId>
<groupId>com.mobidevelop.robovm</groupId>
<artifactId>robovm-maven-plugin</artifactId>
<version>${robovm.maven.version}</version>
</plugin>
Expand All @@ -38,12 +38,12 @@

<dependencies>
<dependency>
<groupId>org.robovm</groupId>
<groupId>com.mobidevelop.robovm</groupId>
<artifactId>robovm-rt</artifactId>
<version>${robovm.version}</version>
</dependency>
<dependency>
<groupId>org.robovm</groupId>
<groupId>com.mobidevelop.robovm</groupId>
<artifactId>robovm-cocoatouch</artifactId>
<version>${robovm.version}</version>
</dependency>
Expand Down

0 comments on commit 3087632

Please sign in to comment.