TacapeForte / android-mock

Automatically exported from code.google.com/p/android-mock
0 stars 0 forks source link

The build system assumes your jar will be in the same directory. #4

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
NA

What is the expected output? What do you see instead?
NA

What version of the product are you using? On what operating system?
r10

Please provide any additional information below.
The current build system assumes easymock.jar, junit.jar and javassist.jar will 
all be the same directory. However, that may not be true, or they may be within 
subdirectories if a project prefers not to keep 2 versions of each. 

I propose this change to fix the issue, allowing the users to specify where the 
files will be; probably something should be done about android.jar too.

Index: src/build-mockgen.xml
===================================================================
--- src/build-mockgen.xml   (revision 10)
+++ src/build-mockgen.xml   (working copy)
@@ -16,8 +16,8 @@

   <!-- Classpaths -->
   <path id="generator.path">
-    <pathelement location="${lib-folder}/${easymock-jar}"/>
-    <pathelement location="${lib-folder}/${javassist-jar}"/>
+    <pathelement location="${easymock-jar.string-path}"/>
+    <pathelement location="${javassist-jar.string-path}"/>
   </path>

   <!--  Private Targets -->
@@ -68,8 +68,8 @@
     <unjar dest="${staging}">
       <fileset dir=".">
         <include name="${mockgen.bin}/${mockgen.nodeps-jar}"/>
-        <include name="${lib-folder}/${easymock-jar}"/>
-        <include name="${lib-folder}/${javassist-jar}"/>
+        <include name="${easymock-jar.string-path}"/>
+        <include name="${javassist-jar.string-path}"/>
       </fileset>
     </unjar>
     <tstamp/>
@@ -79,4 +79,4 @@
       </manifest>
     </jar>
   </target>
-</project>
\ No newline at end of file
+</project>
Index: src/build-runtime.xml
===================================================================
--- src/build-runtime.xml   (revision 10)
+++ src/build-runtime.xml   (working copy)
@@ -13,7 +13,7 @@

   <!-- Classpaths -->
   <path id="path">
-    <pathelement location="${lib-folder}/${easymock-jar}"/>
+    <pathelement location="${easymock-jar.string-path}"/>
   </path>

   <!-- Private Build Targets -->
@@ -47,9 +47,9 @@
     <unjar dest="${staging}">
       <fileset dir=".">
         <include name="${runtime.bin}/${runtime.nodeps-jar}"/>
-        <include name="${lib-folder}/${easymock-jar}"/>
+        <include name="${easymock-jar.string-path}"/>
       </fileset>
     </unjar>
     <jar destfile="${runtime.bin}/${runtime.deploy-jar}" basedir="${staging}"/>
   </target>
-</project>
\ No newline at end of file
+</project>
Index: build.properties
===================================================================
--- build.properties    (revision 10)
+++ build.properties    (working copy)
@@ -3,6 +3,11 @@
 framework.mock-jar=android_framework_mocks.jar
 java-package=com/google/android/testing/mocking
 javassist-jar=javassist.jar
+junit-jar=junit.jar
 lib-folder=lib
 source-base=src
 staging=staging
+easymock-jar.string-path=${lib-folder}/${easymock-jar}
+javassist-jar.string-path=${lib-folder}/${javassist-jar}
+junit-jar.string-path=${lib-folder}/${junit-jar}
+
Index: build.xml
===================================================================
--- build.xml   (revision 10)
+++ build.xml   (working copy)
@@ -30,18 +30,17 @@
   <property name="source-lib-jar" value="AndroidMock-src.jar"/>

   <!-- Android Mock Test Properties -->
-  <property name="junit-jar" value="junit.jar"/>
   <property name="test-bin" value="bin/tests"/>
   <property name="test-results-folder" value="${test-bin}/results"/>
   <property name="test-source-base" value="tests"/>

   <!-- Classpaths -->
   <path id="tests.path">
-    <pathelement location="${lib-folder}/${easymock-jar}"/>
-    <pathelement location="${lib-folder}/${javassist-jar}"/>
+    <pathelement location="${easymock-jar.string-path}"/>
+    <pathelement location="${javassist-jar.string-path}"/>
     <pathelement location="${runtime.bin}/${runtime.deploy-jar}"/>
     <pathelement location="${mockgen.bin}/${mockgen.deploy-jar}"/>
-    <pathelement location="${lib-folder}/${junit-jar}"/>
+    <pathelement location="${junit-jar.string-path}"/>
   </path>

   <!-- Private Build Targets -->

Original issue reported on code.google.com by luissi...@google.com on 11 Jan 2011 at 11:51