This readme details the steps necessary to run retrotranslator on a workspace hosting SCA modules and modified Android modules.

1. Download the Android sandbox:

svn checkout https://svn.apache.org/repos/asf/tuscany/sandbox/mobile-android

2. Download and install the SCA modules:

svn checkout --revision 643746 https://svn.apache.org/repos/asf/tuscany/java/sca/modules

cd modules

mvn clean install -Dtest=no
mvn -Peclipse eclipse:eclipse -Dtest=no

NB: The SCA build consumes a good amount of memory, in case you are seeing issues during the build, set a MAVEN_OPTS environment variable to allocate more memory for the build process.

Windows : SET MAVEN_OPTS=-Xmx512m
Unix : export MAVEN_OPTS=-Xmx512m

3. Create a new Eclipse workspace and set the M2_REPO variable as shown below:

mvn -Declipse.workspace=workspace eclipse:add-maven-repo

4. Import all the projects from step 1, with the exception of tuscany-binding-jsonrpc.

5. Set the Android plugin's preferences to point to the folder /tools/adb inside the SDK folder.

6. Import the following projects from step 2:

tuscany-binding-sca
tuscany-binding-sca-xml
tuscany-contribution-java
tuscany-contribution-namespace
tuscany-contribution-resource
tuscany-contribution-xml
tuscany-databinding
tuscany-databinding-jaxb
tuscany-definitions
tuscany-definitions-xml
tuscany-domain
tuscany-domain-api
tuscany-host-http
tuscany-host-jetty
tuscany-host-webapp
tuscany-host-webapp-junit
tuscany-interface
tuscany-interface-java-xml
tuscany-node
tuscany-node-api
tuscany-policy
tuscany-policy-logging
tuscany-sca-api

7. Remove all projects with an exclamation point (warning) from the Java Build Path of calculator-android. These are the projects that were not imported in the previous step.

8. Similarly fix the Java Build Path for the following modules:

tuscany-assembly-xml
tuscany-definitions-xml
tuscany-definitions
tuscany-host-embedded
tuscany-host-webapp
tuscany-interface-java-jaxws

9. Add a User Library "Android Library" with the android.jar to the following projects:

android-jdk-classes
tuscany-contribution-impl
tuscany-host-embedded
tuscany-host-webapp

10. Add the following JARs to calculator-android:

activation-1.1.jar
axiom-api-1.2.5.jar
cgilib-nodep-2.1_3.jar
geronimo-commonj_1.1_spec-1.0.jar
stax-1.2.0.jar
stax-api-1.0-2.jar

11. Remove 'tuscany-interface-java-jaxws/target/classes' from the Source section of the Java Build Path of tuscany-interface-java-jaxws.

12. Add the JRE System Library to the following projects:

tuscany-core
tuscany-host-embedded

13. Clean and build the workspace.

14. Disable the "Java Builder" from all projects.

15. Run retrotranslator on the workspace or, in case you chose not to copy projects to the workspace, run retrotranslator on mobile-android and modules downloaded in steps 1 and 2, as shown below:

java -jar ../Retrotranslator-1.2.7-bin/retrotranslator-transformer-1.2.7.jar -srcdir ../srcdir -target 1.5 -reflection safe -stripannot -classpath ../Retrotranslator-1.2.7-bin/retrotranslator-android-1.2.7.jar -verbose

NB: Use the newest version of Retrotranslator, version 1.2.7.

16. Add the following JARs as external JARs to calculator-android:

retrotranslator-android-1.2.7.jar
retrotranslator-runtime-1.2.7.jar

17. Rebuild workspace.

18. Run calculator-android. The result will be:

org.osoa.sca.ServiceUnavailableException: Service not found for component CalculatorServiceComponent reference setAddService (bindingURI=null operation=add). Ensure that the composite containing the service is loaded and started somewhere in the SCA domain and that if running in a remote node that the interface of the target service marked as @Remotable

  • No labels