summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Schneider-Kennedy2013-11-17 23:39:20 (EST)
committer Stefan Schneider-Kennedy2013-11-30 13:23:03 (EST)
commitddc32b3c09ca80c6997c7f54e5553a15db3c0eb0 (patch)
tree923bdca3f5956c22e253f53a969fc83d4f0725a0
parent82af25e5b59d77919cab6918789f7ee819ce320e (diff)
downloadorg.eclipse.xtext-ddc32b3c09ca80c6997c7f54e5553a15db3c0eb0.zip
org.eclipse.xtext-ddc32b3c09ca80c6997c7f54e5553a15db3c0eb0.tar.gz
org.eclipse.xtext-ddc32b3c09ca80c6997c7f54e5553a15db3c0eb0.tar.bz2
[xtend][maven][android] Update android xtend maven archetyperefs/changes/76/18876/2
* Project can now be compiled and installed from Eclipse (with Run As) as well as from the command line. * Debugging works from eclipse (android debug settings are enabled by default). * Updated referenced android version to the latest (4.3) * Updated some android resources to more closely match the Eclipse wizard generated projects. Change-Id: I8788d3e50d5d5bc8a6fa3547e8815a9437bd4926 Signed-off-by: Stefan Schneider-Kennedy <code@stefansk.name>
-rw-r--r--maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/META-INF/maven/archetype-metadata.xml27
-rw-r--r--maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/.classpath25
-rw-r--r--maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/.project6
-rw-r--r--maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/AndroidManifest.xml4
-rw-r--r--maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/README9
-rw-r--r--maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/pom.xml114
-rw-r--r--maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/project.properties2
-rw-r--r--maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/res/layout/activity_main.xml6
-rw-r--r--maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/res/values-v11/styles.xml11
-rw-r--r--maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/res/values-v14/styles.xml12
-rw-r--r--maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/src/MainActivity.xtend12
11 files changed, 123 insertions, 105 deletions
diff --git a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
index 1d9d02f..1408e57 100644
--- a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -5,14 +5,8 @@
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<requiredProperties>
- <requiredProperty key="sdk_path">
- <defaultValue>/opt/local/android-sdk-macosx</defaultValue>
- </requiredProperty>
<requiredProperty key="platform_version">
- <defaultValue>4.2.2</defaultValue>
- </requiredProperty>
- <requiredProperty key="avd_name">
- <defaultValue>Android_2.1</defaultValue>
+ <defaultValue>4.3</defaultValue>
</requiredProperty>
</requiredProperties>
<fileSets>
@@ -35,6 +29,24 @@
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
+ <directory>res/values-v11</directory>
+ <includes>
+ <include>**/*.xml</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>res/values-v14</directory>
+ <includes>
+ <include>**/*.xml</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>res/values</directory>
+ <includes>
+ <include>**/*.xml</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
<directory>res/values-sw720dp-land</directory>
<includes>
<include>**/*.xml</include>
@@ -96,6 +108,7 @@
<include>AndroidManifest.xml</include>
<include>proguard-project.txt</include>
<include>project.properties</include>
+ <include>README</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8">
diff --git a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/.classpath b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/.classpath
index c4ef3cf..4840b32 100644
--- a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/.classpath
+++ b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/.classpath
@@ -3,9 +3,28 @@
#set( $symbol_escape = '\' )
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="gen"/>
+ <classpathentry kind="src" path="gen">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
+ <classpathentry kind="src" output="bin/classes" path="src">
+ <attributes>
+ <attribute name="optional" value="true"/>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
diff --git a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/.project b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/.project
index 72b1901..6a53ab5 100644
--- a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/.project
+++ b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/.project
@@ -33,8 +33,14 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
diff --git a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/AndroidManifest.xml b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/AndroidManifest.xml
index f0a5d64..069d551 100644
--- a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/AndroidManifest.xml
+++ b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/AndroidManifest.xml
@@ -9,7 +9,7 @@
<uses-sdk
android:minSdkVersion="7"
- android:targetSdkVersion="17" />
+ android:targetSdkVersion="18" />
<application
android:allowBackup="true"
@@ -27,4 +27,4 @@
</activity>
</application>
-</manifest> \ No newline at end of file
+</manifest>
diff --git a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/README b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/README
new file mode 100644
index 0000000..a3eb34b
--- /dev/null
+++ b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/README
@@ -0,0 +1,9 @@
+You need ANDROID_HOME set to use command line maven to build the project.
+
+To use this archetype in Eclipse you will need to have the following installed:
+* Eclipse m2e (maven integration)
+* Xtend Eclipse plugin
+* Android Eclipse plugin
+You may also need to clean the project after generating from the archetype in order for the .xtend file to be processed.
+
+To use the android support library (support-v4.jar and friends) see the instructions in pom.xml.
diff --git a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/pom.xml b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/pom.xml
index e5871ac..9c12591 100644
--- a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/pom.xml
+++ b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/pom.xml
@@ -10,24 +10,43 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <android.plugin.version>3.6.1</android.plugin.version>
<xtend.version>${project.version}</xtend.version>
- <sdkPath>\${sdk_path}</sdkPath>
<platform.version>\${platform_version}</platform.version>
- <avd.name>\${avd_name}</avd.name>
</properties>
+ <!--
+ Uncomment this (and the dependency below) to use support-v4.jar and friends.
+ You will need ANDROID_HOME set, and the 'android support repository' installed
+ on your machine.
+ Alternatively you can try using https://github.com/mosabua/maven-android-sdk-deployer
+ <repositories>
+ <repository>
+ <id>android-support-repository</id>
+ <url>file:///\${env.ANDROID_HOME}/extras/android/m2repository/</url>
+ </repository>
+ </repositories>
+ -->
+
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
- <version>2.2.1</version>
+ <version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.eclipse.xtext</groupId>
- <artifactId>org.eclipse.xtext.xbase.lib</artifactId>
+ <groupId>org.eclipse.xtend</groupId>
+ <artifactId>org.eclipse.xtend.lib</artifactId>
<version>${xtend.version}</version>
</dependency>
+ <!--
+ <dependency>
+ <groupId>com.android.support</groupId>
+ <artifactId>support-v4</artifactId>
+ <version>18.0.0</version>
+ </dependency>
+ -->
</dependencies>
<build>
@@ -37,7 +56,7 @@
<plugin>
<groupId>org.eclipse.xtend</groupId>
<artifactId>xtend-maven-plugin</artifactId>
- <version>${xtend.version}</version>
+ <version>\${xtend.version}</version>
<executions>
<execution>
<goals>
@@ -45,57 +64,25 @@
</goals>
</execution>
</executions>
+ <configuration>
+ <outputDirectory>target/generated-sources/</outputDirectory>
+ </configuration>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
- <genDirectory>gen</genDirectory>
+ <genDirectory>target/generated-sources/</genDirectory>
<run>
<debug>true</debug>
</run>
<sdk>
- <platform>${platform.version}</platform>
- <path>${sdkPath}</path>
+ <platform>\${platform.version}</platform>
</sdk>
- <emulator>
- <avd>${avd.name}</avd>
- <wait>180000</wait>
- </emulator>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.6</version>
- <executions>
- <execution>
- <id>copy-dependencies</id>
- <phase>process-resources</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <excludeScope>provided</excludeScope>
- <outputDirectory>\${basedir}/libs</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
<pluginManagement>
@@ -103,48 +90,9 @@
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
- <version>3.5.3</version>
+ <version>\${android.plugin.version}</version>
<extensions>true</extensions>
</plugin>
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>com.jayway.maven.plugins.android.generation2</groupId>
- <artifactId>android-maven-plugin</artifactId>
- <versionRange>[3.5.1,)</versionRange>
- <goals>
- <goal>generate-sources</goal>
- <goal>proguard</goal>
- <goal>run</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore />
- </action>
- </pluginExecution>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <versionRange>[2.6,)</versionRange>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore></ignore>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
</plugins>
</pluginManagement>
</build>
diff --git a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/project.properties b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/project.properties
index b00521e..26bbfdd 100644
--- a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/project.properties
+++ b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/project.properties
@@ -14,4 +14,4 @@ ${symbol_pound} To enable ProGuard to shrink and obfuscate your code, uncomment
${symbol_pound}proguard.config=${symbol_dollar}{sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
${symbol_pound} Project target.
-target=android-7
+target=android-18
diff --git a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/res/layout/activity_main.xml b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/res/layout/activity_main.xml
index dba205b..e6ad3fc 100644
--- a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/res/layout/activity_main.xml
+++ b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/res/layout/activity_main.xml
@@ -3,8 +3,8 @@
#set( $symbol_escape = '\' )
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
@@ -16,4 +16,4 @@
android:layout_height="wrap_content"
android:text="@string/hello_world" />
-</RelativeLayout> \ No newline at end of file
+</RelativeLayout>
diff --git a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/res/values-v11/styles.xml b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/res/values-v11/styles.xml
new file mode 100644
index 0000000..3c02242
--- /dev/null
+++ b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/res/values-v11/styles.xml
@@ -0,0 +1,11 @@
+<resources>
+
+ <!--
+ Base application theme for API 11+. This theme completely replaces
+ AppBaseTheme from res/values/styles.xml on API 11+ devices.
+ -->
+ <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
+ <!-- API 11 theme customizations can go here. -->
+ </style>
+
+</resources>
diff --git a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/res/values-v14/styles.xml b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/res/values-v14/styles.xml
new file mode 100644
index 0000000..a91fd03
--- /dev/null
+++ b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/res/values-v14/styles.xml
@@ -0,0 +1,12 @@
+<resources>
+
+ <!--
+ Base application theme for API 14+. This theme completely replaces
+ AppBaseTheme from BOTH res/values/styles.xml and
+ res/values-v11/styles.xml on API 14+ devices.
+ -->
+ <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
+ <!-- API 14 theme customizations can go here. -->
+ </style>
+
+</resources>
diff --git a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/src/MainActivity.xtend b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/src/MainActivity.xtend
index e796828..5809a08 100644
--- a/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/src/MainActivity.xtend
+++ b/maven/org.eclipse.xtend.maven.android.archetype/src/main/resources/archetype-resources/src/MainActivity.xtend
@@ -1,20 +1,20 @@
-package ${package};
+package ${package}
-import android.app.Activity
import android.os.Bundle
+import android.app.Activity
import android.view.Menu
class MainActivity extends Activity {
override onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState)
- contentView = R.layout.activity_main
+ setContentView(R.layout.activity_main)
}
- override onCreateOptionsMenu(Menu m) {
+ override onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
- menuInflater.inflate(R.menu.main, m)
- return true
+ menuInflater.inflate(R.menu.main, menu)
+ true
}
}