aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Douglass <erich.douglass@gmail.com>2015-01-06 15:55:56 -0800
committerErich Douglass <erich.douglass@gmail.com>2015-01-06 15:56:17 -0800
commit4a8d9f666506e2b189dc0c8bfed705f2930252a4 (patch)
treeb79c2c91703d656f61d9fa4f55bd9d74a147a97d
parentd0c25cc459f953c7580f06c206847149b8027c50 (diff)
downloadrobolectric-shadows-4a8d9f666506e2b189dc0c8bfed705f2930252a4.tar.gz
Deploy all artifacts to Sonatype at once so that the SNAPSHOT versions match.
-rw-r--r--.gitignore1
-rw-r--r--robolectric-shadows/shadows-core/pom.xml158
-rwxr-xr-xscripts/install-robolectric.sh3
-rwxr-xr-xscripts/install-snapshot.sh30
4 files changed, 184 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore
index 01948861e..618257500 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@ bin/
out/
# Maven
+dist
target
pom.xml.*
release.properties
diff --git a/robolectric-shadows/shadows-core/pom.xml b/robolectric-shadows/shadows-core/pom.xml
index fbc025632..958db4068 100644
--- a/robolectric-shadows/shadows-core/pom.xml
+++ b/robolectric-shadows/shadows-core/pom.xml
@@ -126,6 +126,7 @@
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<classifier>${api}</classifier>
+ <outputDirectory>dist</outputDirectory>
</configuration>
</plugin>
@@ -142,6 +143,7 @@
<artifactId>maven-source-plugin</artifactId>
<configuration>
<classifier>${api}-sources</classifier>
+ <outputDirectory>dist</outputDirectory>
</configuration>
</plugin>
@@ -150,6 +152,7 @@
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<classifier>${api}-javadoc</classifier>
+ <jarOutputDirectory>${basedir}/dist</jarOutputDirectory>
</configuration>
</plugin>
@@ -204,6 +207,7 @@
<version>1.9.1</version>
<executions>
<execution>
+ <id>add-source-directories</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
@@ -288,5 +292,159 @@
<activeByDefault>true</activeByDefault>
</activation>
</profile>
+
+ <profile>
+ <id>dist</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>dist</directory>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>upload</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.9.1</version>
+ <executions>
+ <execution>
+ <id>add-source-directories</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>target/generated-shadows</source>
+ <source>target/generated-sources</source>
+ </sources>
+ </configuration>
+ </execution>
+
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>dist/shadows-core-3.0-SNAPSHOT-15.jar</file>
+ <type>jar</type>
+ <classifier>15</classifier>
+ </artifact>
+ <artifact>
+ <file>dist/shadows-core-3.0-SNAPSHOT-15-javadoc.jar</file>
+ <type>jar</type>
+ <classifier>15-javadoc</classifier>
+ </artifact>
+ <artifact>
+ <file>dist/shadows-core-3.0-SNAPSHOT-15-sources.jar</file>
+ <type>jar</type>
+ <classifier>15-sources</classifier>
+ </artifact>
+
+ <artifact>
+ <file>dist/shadows-core-3.0-SNAPSHOT-16.jar</file>
+ <type>jar</type>
+ <classifier>16</classifier>
+ </artifact>
+ <artifact>
+ <file>dist/shadows-core-3.0-SNAPSHOT-16-javadoc.jar</file>
+ <type>jar</type>
+ <classifier>16-javadoc</classifier>
+ </artifact>
+ <artifact>
+ <file>dist/shadows-core-3.0-SNAPSHOT-16-sources.jar</file>
+ <type>jar</type>
+ <classifier>16-sources</classifier>
+ </artifact>
+
+ <artifact>
+ <file>dist/shadows-core-3.0-SNAPSHOT-17.jar</file>
+ <type>jar</type>
+ <classifier>17</classifier>
+ </artifact>
+ <artifact>
+ <file>dist/shadows-core-3.0-SNAPSHOT-17-javadoc.jar</file>
+ <type>jar</type>
+ <classifier>17-javadoc</classifier>
+ </artifact>
+ <artifact>
+ <file>dist/shadows-core-3.0-SNAPSHOT-17-sources.jar</file>
+ <type>jar</type>
+ <classifier>17-sources</classifier>
+ </artifact>
+
+ <artifact>
+ <file>dist/shadows-core-3.0-SNAPSHOT-18.jar</file>
+ <type>jar</type>
+ <classifier>18</classifier>
+ </artifact>
+ <artifact>
+ <file>dist/shadows-core-3.0-SNAPSHOT-18-javadoc.jar</file>
+ <type>jar</type>
+ <classifier>18-javadoc</classifier>
+ </artifact>
+ <artifact>
+ <file>dist/shadows-core-3.0-SNAPSHOT-18-sources.jar</file>
+ <type>jar</type>
+ <classifier>18-sources</classifier>
+ </artifact>
+
+ <artifact>
+ <file>dist/shadows-core-3.0-SNAPSHOT-19.jar</file>
+ <type>jar</type>
+ <classifier>19</classifier>
+ </artifact>
+ <artifact>
+ <file>dist/shadows-core-3.0-SNAPSHOT-19-javadoc.jar</file>
+ <type>jar</type>
+ <classifier>19-javadoc</classifier>
+ </artifact>
+ <artifact>
+ <file>dist/shadows-core-3.0-SNAPSHOT-19-sources.jar</file>
+ <type>jar</type>
+ <classifier>19-sources</classifier>
+ </artifact>
+
+ <artifact>
+ <file>dist/shadows-core-3.0-SNAPSHOT-21.jar</file>
+ <type>jar</type>
+ <classifier>21</classifier>
+ </artifact>
+ <artifact>
+ <file>dist/shadows-core-3.0-SNAPSHOT-21-javadoc.jar</file>
+ <type>jar</type>
+ <classifier>21-javadoc</classifier>
+ </artifact>
+ <artifact>
+ <file>dist/shadows-core-3.0-SNAPSHOT-21-sources.jar</file>
+ <type>jar</type>
+ <classifier>21-sources</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
diff --git a/scripts/install-robolectric.sh b/scripts/install-robolectric.sh
index 64960adad..75e15051a 100755
--- a/scripts/install-robolectric.sh
+++ b/scripts/install-robolectric.sh
@@ -5,6 +5,7 @@ set -e
PROJECT=$(cd $(dirname "$0")/..; pwd)
# Build everything
+cd "$PROJECT"; mvn clean -Pdist
cd "$PROJECT"; mvn clean install -DskipTests
# Build older shadow packages
@@ -15,4 +16,4 @@ cd "$PROJECT"/robolectric-shadows/shadows-core; mvn clean velocity:velocity inst
cd "$PROJECT"/robolectric-shadows/shadows-core; mvn clean velocity:velocity install -Pandroid-19
# Build everything with tests (tests require the shadows)
-cd "$PROJECT"; mvn install
+cd "$PROJECT"; mvn test
diff --git a/scripts/install-snapshot.sh b/scripts/install-snapshot.sh
index d140ef533..383a3cedc 100755
--- a/scripts/install-snapshot.sh
+++ b/scripts/install-snapshot.sh
@@ -9,13 +9,29 @@ ARGUMENTS="--settings $PROJECT/scripts/mvn_settings.xml -DskipTests"
echo "Pull request: '${TRAVIS_PULL_REQUEST}' on branch '${TRAVIS_BRANCH}'"
if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ]; then
- # Install everything
- cd "$PROJECT"; mvn ${ARGUMENTS} deploy
+ echo "Cleaning dist directories..."
+ cd "$PROJECT"; mvn ${ARGUMENTS} clean -Pdist
# Install older shadow packages
- cd "$PROJECT"/robolectric-shadows/shadows-core; mvn ${ARGUMENTS} clean velocity:velocity deploy -Pandroid-15
- cd "$PROJECT"/robolectric-shadows/shadows-core; mvn ${ARGUMENTS} clean velocity:velocity deploy -Pandroid-16
- cd "$PROJECT"/robolectric-shadows/shadows-core; mvn ${ARGUMENTS} clean velocity:velocity deploy -Pandroid-17
- cd "$PROJECT"/robolectric-shadows/shadows-core; mvn ${ARGUMENTS} clean velocity:velocity deploy -Pandroid-18
- cd "$PROJECT"/robolectric-shadows/shadows-core; mvn ${ARGUMENTS} clean velocity:velocity deploy -Pandroid-19
+ echo "Building shadows for API 15..."
+ cd "$PROJECT"/robolectric-shadows/shadows-core; mvn ${ARGUMENTS} clean velocity:velocity package -Pandroid-15
+
+ echo "Building shadows for API 16..."
+ cd "$PROJECT"/robolectric-shadows/shadows-core; mvn ${ARGUMENTS} clean velocity:velocity package -Pandroid-16
+
+ echo "Building shadows for API 17..."
+ cd "$PROJECT"/robolectric-shadows/shadows-core; mvn ${ARGUMENTS} clean velocity:velocity package -Pandroid-17
+
+ echo "Building shadows for API 18..."
+ cd "$PROJECT"/robolectric-shadows/shadows-core; mvn ${ARGUMENTS} clean velocity:velocity package -Pandroid-18
+
+ echo "Building shadows for API 19..."
+ cd "$PROJECT"/robolectric-shadows/shadows-core; mvn ${ARGUMENTS} clean velocity:velocity package -Pandroid-19
+
+ # Install everything
+ echo "Cleaning project..."
+ cd "$PROJECT"; mvn ${ARGUMENTS} clean
+
+ echo "Building API 21 and uploading artifacts to Sonatype..."
+ cd "$PROJECT"; mvn ${ARGUMENTS} deploy -Pupload,android-21
fi