Permalink
Browse files

relocate and remove not used jars, using android-maven-plugin instead

  • Loading branch information...
1 parent 435b118 commit e2dfdc8b45407178eae72fbf5a4ce3190b4e7b9f @activars committed Jun 22, 2011
@@ -1,105 +0,0 @@
-??
-<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>
- <artifactId>robotium</artifactId>
- <groupId>com.jayway.android.robotium</groupId>
- <version>1.6.1-SNAPSHOT</version>
- </parent>
- <groupId>com.jayway.android.robotium.robotium-server</groupId>
- <artifactId>robotium-server</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <packaging>pom</packaging>
- <name>Robotium :: Remote Server</name>
- <description>Remote Server package, including app and test</description>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>com.google.android</groupId>
- <artifactId>android</artifactId>
- <version>1.6_r2</version>
- <type>jar</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.google.android</groupId>
- <artifactId>android-test</artifactId>
- <version>1.6_r2</version>
- <type>jar</type>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <profiles>
- <!-- build all profile -->
- <profile>
- <id>all</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>robotium-server-app</module>
- <module>robotium-server-test</module>
- </modules>
- </profile>
-
- <!-- App build profile -->
- <profile>
- <id>app-build</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules> <!-- only building the application here -->
- <module>robotium-server-app</module>
- </modules>
- </profile>
-
- <!-- Instrumentation test profile -->
- <profile>
- <id>instrument</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <modules>
- <module>robotium-server-test</module>
- </modules>
- </profile>
-
- <!--sign and release profile -->
- <profile>
- <id>release</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <modules>
- <module>robotium-server-app</module>
- </modules>
- </profile>
- </profiles>
- <modules>
- <module>robotium-server-app</module>
- </modules>
-
- <!--default settings common to all profiles unless overriden -->
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>com.jayway.maven.plugins.android.generation2</groupId>
- <artifactId>maven-android-plugin</artifactId>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-</project>
@@ -1,3 +0,0 @@
-# project specific, keep the eclipse project setting for now
-!.project
-!.classpath
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,181 +0,0 @@
-??
-<?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">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>com.jayway.android.robotium.robotium-server</groupId>
- <artifactId>robotium-server</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </parent>
-
- <groupId>com.jayway.android.robotium.robotium-server-app</groupId>
- <artifactId>robotium-server-app</artifactId>
- <version>0.0.1</version>
- <packaging>apk</packaging>
- <name>Robotium :: Remote Server</name>
-
- <description>Robotium Server Android Application</description>
-
-
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <url>http://repository.jboss.org/nexus/content/groups/public/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
-
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.netty</groupId>
- <artifactId>netty</artifactId>
- <version>3.1.0.GA</version>
- <scope>provided</scope>
- </dependency>
-
-
- <dependency>
- <groupId>com.google.android</groupId>
- <artifactId>android</artifactId>
- <version>1.6_r2</version>
- <type>jar</type>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <type>jar</type>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <!--default case. acts when no profile selected-->
- <!--
- the application gets installed into the local maven repository so that
- the instrumentation test project can use it
- -->
- <build>
- <defaultGoal>install</defaultGoal>
- <finalName>${project.artifactId}-${project.version}</finalName>
- <plugins>
- <plugin>
- <groupId>com.jayway.maven.plugins.android.generation2</groupId>
- <artifactId>maven-android-plugin</artifactId>
-
- </plugin>
-
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
- <!--
- needs additional config/parameters to work: a keystore along with
- access data to it. parameters for the keystore as seen below
- -->
- <profiles>
- <profile>
- <!--
- release profile. uses keystore defined in keystore.* properties.
- signs and zipaligns the app to the target folder
- -->
- <id>release</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <build>
- <defaultGoal>install</defaultGoal>
- <finalName>${project.artifactId}-${project.version}</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jarsigner-plugin</artifactId>
- <version>1.2</version>
- <executions>
- <execution>
- <id>signing</id>
- <goals>
- <goal>sign</goal>
- </goals>
- <phase>package</phase>
- <inherited>true</inherited>
- <configuration>
- <includes>
- <include>${project.build.directory}/target/${project.artifactId}-${project.version}.apk</include>
- </includes>
- <keystore>${keystore.location}</keystore>
- <storepass>${keystore.password}</storepass>
- <keypass>${keystore.keypass}</keypass>
- <alias>${keystore.alias}</alias>
- <verbose>true</verbose>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>com.jayway.maven.plugins.android.generation2</groupId>
- <artifactId>maven-android-plugin</artifactId>
- <configuration>
- <zipalign>
- <verbose>true</verbose>
- <skip>false</skip><!-- defaults to true -->
- <inputApk>${project.build.directory}/${project.artifactId}-${project.version}.apk</inputApk>
- <outputApk>${project.build.directory}/RobotiumServer_v${project.version}.apk</outputApk>
- </zipalign>
- <sign>
- <debug>false</debug>
- </sign>
- </configuration>
- <executions>
- <execution>
- <id>zipalign</id>
- <phase>verify</phase>
- <goals>
- <goal>zipalign</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile><!-- builds an unsigned apk-->
- <id>unsign</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <defaultGoal>install</defaultGoal>
- <finalName>RobotiumServer_v${project.version}_unsigned</finalName>
- <plugins>
- <plugin>
- <groupId>com.jayway.maven.plugins.android.generation2</groupId>
- <artifactId>maven-android-plugin</artifactId>
- <configuration>
- <sign>
- <debug>false</debug>
- </sign>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-<properties>
- <keystore.location>~/.android/debug.keystore</keystore.location>
- <keystore.password>android</keystore.password>
- <keystore.keypass>android</keystore.keypass>
- <keystore.alias>androiddebugkey</keystore.alias>
-</properties>
-
-</project>
@@ -1,92 +0,0 @@
-package com.jayway.android.robotium.server;
-
-
-import java.net.InetSocketAddress;
-import java.util.concurrent.Executors;
-
-import org.jboss.netty.bootstrap.ServerBootstrap;
-import org.jboss.netty.channel.Channel;
-import org.jboss.netty.channel.group.ChannelGroup;
-import org.jboss.netty.channel.group.DefaultChannelGroup;
-import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
-
-import android.app.Instrumentation;
-import android.os.Bundle;
-import android.os.Looper;
-import android.util.Log;
-
-public class InstrumentationRunner extends Instrumentation {
-
- private static final String TAG = "InstrumentationRunner";
- public static boolean isClosed = true;
- private ServerBootstrap bootstrap;
- private ChannelGroup channelGroup;
-
-
- @Override
- public void onCreate(Bundle arguments) {
- super.onCreate(arguments);
- Log.d(TAG, "Intrumentation calling onCreate");
-
- //default port number for running server
- int portNum = 8080;
- if(arguments.containsKey("port")) {
- String portString = arguments.getString("port");
- portNum = Integer.parseInt(portString);
- }
-
- Log.d(TAG, "Obtained port number from shared pref:" + portNum);
-
-
- bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(
- Executors.newCachedThreadPool(), Executors
- .newCachedThreadPool()));
-
- bootstrap.setOption("keepAlive", true);
-
- Log.d(TAG, "Server bootstrap initialized");
-
- // channel group is used for closing connection properly
- channelGroup = new DefaultChannelGroup();
-
- // Configure the pipeline factory.
- // pipline created internally, the ServerHandler can be obtained by:
- // ((ServerHandler)bootstrap.getPipeline().get(ServerPipelineFactory.SERVER_HANDLER))
- // or less safely:
- // ((ServerHandler)bootstrap.getPipeline().getLast())
- ServerPipelineFactory pipelineFactory = new ServerPipelineFactory();
- pipelineFactory.setInstrumentation(this);
- bootstrap.setPipelineFactory(pipelineFactory);
- Log.d(TAG, "Configured server pipline factory");
-
- // NOTE: This is a work around to prevent the bad address error.
- // This was a bug exposed on Android 2.2
- // http://code.google.com/p/android/issues/detail?id=9431
- System.setProperty("java.net.preferIPv6Addresses", "false");
-
- // Bind and start to accept incoming connections.
- Channel channel = bootstrap.bind(new InetSocketAddress(portNum));
- channelGroup.add(channel);
- Log.d(TAG, "Server is now running");
-
- start();
- }
-
-
- /**
- * Starts Instrumentation and pass itself to server handler
- */
- @Override
- public void onStart() {
- Looper.prepare();
-
- Log.d(TAG, "Intrumentation started");
- }
-
- public void onDestroy() {
- Log.d(TAG, "Intrumentation Destroyed");
- }
-
-
-
-}
Oops, something went wrong.

0 comments on commit e2dfdc8

Please sign in to comment.