-
Notifications
You must be signed in to change notification settings - Fork 7
/
pom.xml
146 lines (143 loc) · 6.64 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<!-- Define the app's name and version. Packaging type must be apk -->
<modelVersion>4.0.0</modelVersion>
<groupId>com.hsaliak</groupId>
<artifactId>helloflashlight</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>apk</packaging>
<name>HelloFlashlight</name>
<!-- The android version is based on your SDK version. maven android plugin has more information on the allowed version. The android artifacts are now available in the maven repository -->
<!-- Dependencies for the project, this section lists the projects our project depends on and optionally the scope of the depdendency -->
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>2.2.1</version>
<scope>provided</scope>
</dependency>
<!-- Clojure Deps. Clojure contrib is not used in this example, but imported as a reference here. -->
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure</artifactId>
<version>1.2.0</version>
</dependency>
<!-- <dependency> -->
<!-- <groupId>org.clojure</groupId> -->
<!-- <artifactId>clojure-contrib</artifactId> -->
<!-- <version>1.2.0</version> -->
<!-- </dependency> -->
<!-- This dependancy is needed by the clojure swank plugin. The clojars repository is needed for this plugin. -->
<dependency>
<groupId>swank-clojure</groupId>
<artifactId>swank-clojure</artifactId>
<version>1.3.0-SNAPSHOT</version>
</dependency>
<!-- Add dependancy on ProGuard to make our executable smaller -->
</dependencies>
<!-- This section lists the plugins that need to be invoked in the build process and the phase in which they need to be invoked. Also includes plugin specific config -->
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<!-- This is the clojure plugin. code goes by default into
src/main/clojure. However, since the android tool creates the project structure differently, the sourceDirectories configuration below is needed to make sure that the clojure files are found in the right place. Standard conventions apply, src/com/hsaliak/HelloFlashlight.clj will be in the ns com.hsaliak.HelloFlashlight -->
<plugin>
<groupId>com.theoryinpractise</groupId>
<artifactId>clojure-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<sourceDirectories>
<sourceDirectory>src</sourceDirectory>
</sourceDirectories>
</configuration>
<executions>
<execution>
<id>compile-clojure</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.pyx4me</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.0.4</version>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard</artifactId>
<version>4.4</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<executions>
<execution>
<!-- After compile phase. -->
<phase>process-classes</phase>
<goals><goal>proguard</goal></goals>
</execution>
</executions>
<configuration>
<!-- Once all classes have been generated, they are placed into android-classes. Pass it to proguard as input.-->
<!-- Make proguard overwrite the default location. The original classes will be moved to android-classes-proguard_base-->
<!-- This is required as the next phases (dexing and packaging) cannot be provided an input jar as per my understanding.-->
<injar>android-classes</injar>
<outjar>android-classes</outjar>
<proguardVersion>4.4</proguardVersion>
<libs>
<!-- additional libraray jars, this can also be specified in proguard.cfg using the libraryjars option,however, providing it here makes sense as $JAVA_HOME can be sourced. Note - $JAVA_HOME needs to be set. -->
<lib>${java.home}/lib/rt.jar</lib>
<!-- <lib>${java.home}/lib/jsse.jar</lib> -->
</libs>
<!-- This allows us to source a native proguard.cfg. It is easier than cluttering this xml file with option tags -->
<proguardInclude>proguard.cfg</proguardInclude>
</configuration>
</plugin>
<!-- Android plugin. I have done a couple of things differently here than in the original examples. Firstly, the verson is 2.8.4. Froyo is the name of my avd, change it to your avd name. Platform 8 corresponds to Froyo. undeployBeforeDeploy is something I find essential. It deletes your app from the emulator before the new one is installed. -->
<plugin>
<groupId>
com.jayway.maven.plugins.android.generation2
</groupId>
<artifactId>maven-android-plugin</artifactId>
<version>2.8.4</version>
<configuration>
<emulator>
<avd>froyo</avd>
</emulator>
<sdk>
<platform>8</platform>
</sdk>
<deleteConflictingFiles>
true
</deleteConflictingFiles>
<undeployBeforeDeploy> true </undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<!-- This is enabled by default so I did not enable it. Does not cause any issues. It is however, enabled in the maven-android examples. -->
<!-- <plugin> -->
<!-- <artifactId>maven-compiler-plugin</artifactId> -->
<!-- <configuration> -->
<!-- <source>2.3</source> -->
<!-- </configuration> -->
<!-- </plugin> -->
<!-- Proguard plugin for making the executables smaller, should help with the load time also, config taken from http://code.google.com/p/maven-android-plugin/wiki/ProGuard -->
</plugins>
<!-- Now we need to make sure that the apk uses this proguard run code. -->
</build>
<repositories>
<repository>
<id>clojure</id>
<url>http://build.clojure.org/releases</url>
</repository>
<repository>
<id>clojars</id>
<url>http://clojars.org/repo</url>
</repository>
</repositories>
</project>