[Esbox-commits] r886 - in branches/micaSplit: . org.maemo.esbox.analysis org.maemo.esbox.analysis/.settings org.maemo.esbox.analysis/META-INF org.maemo.esbox.analysis/src org.maemo.esbox.analysis/src/org org.maemo.esbox.analysis/src/org/maemo org.maemo.esbox.analysis/src/org/maemo/esbox org.maemo.esbox.analysis/src/org/maemo/esbox/internal org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/adapters org.maemo.esbox.maemosdk.tests org.maemo.esbox.maemosdk.tests/.settings org.maemo.esbox.maemosdk.tests/META-INF org.maemo.esbox.maemosdk.tests/src org.maemo.esbox.maemosdk.tests/src/org org.maemo.esbox.maemosdk.tests/src/org/maemo org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands org.maemo.esbox.product org.maemo.esbox.product/.settings org.maemo.esbox.product/META-INF org.maemo.esbox.product/icons org.maemo.esbox.product/intro org.maemo.esbox.product/intro/css org.maemo.esbox.product/src org.maemo.esbox.product/src/org org.maemo.esbox.product/src/org/maemo org.maemo.esbox.product/src/org/maemo/esbox org.maemo.esbox.product/src/org/maemo/esbox/product org.maemo.esbox.product-feature org.maemo.esbox.product-feature/licenses org.maemo.esbox.product.supplement-feature org.maemo.esbox.product.supplement-feature/licenses org.maemo.esbox.scratchbox.sb1 org.maemo.esbox.scratchbox.sb1/META-INF org.maemo.esbox.scratchbox.sb1/conf org.maemo.esbox.scratchbox.sb1/src org.maemo.esbox.scratchbox.sb1/src/org org.maemo.esbox.scratchbox.sb1/src/org/maemo org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1 org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/provider org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/preferences org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/sb1 org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/sb1/sdk org.maemo.esbox.scratchbox.sb2 org.maemo.esbox.scratchbox.sb2/META-INF org.maemo.esbox.scratchbox.sb2/conf org.maemo.esbox.scratchbox.sb2/icons org.maemo.esbox.scratchbox.sb2/icons/full org.maemo.esbox.scratchbox.sb2/icons/full/obj16 org.maemo.esbox.scratchbox.sb2/src org.maemo.esbox.scratchbox.sb2/src/org org.maemo.esbox.scratchbox.sb2/src/org/maemo org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/api org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/api/scratchbox org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/api/scratchbox/sb2 org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/api/scratchbox/sb2/core org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2 org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/launcher org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/provider org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/preferences org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2 org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk
eswartz at garage.maemo.org
eswartz at garage.maemo.org
Thu Oct 23 15:55:08 EEST 2008
Author: eswartz
Date: 2008-10-23 15:55:05 +0300 (Thu, 23 Oct 2008)
New Revision: 886
Added:
branches/micaSplit/org.maemo.esbox.analysis/
branches/micaSplit/org.maemo.esbox.analysis/.classpath
branches/micaSplit/org.maemo.esbox.analysis/.project
branches/micaSplit/org.maemo.esbox.analysis/.settings/
branches/micaSplit/org.maemo.esbox.analysis/.settings/org.eclipse.jdt.core.prefs
branches/micaSplit/org.maemo.esbox.analysis/META-INF/
branches/micaSplit/org.maemo.esbox.analysis/META-INF/MANIFEST.MF
branches/micaSplit/org.maemo.esbox.analysis/build.properties
branches/micaSplit/org.maemo.esbox.analysis/plugin.xml
branches/micaSplit/org.maemo.esbox.analysis/src/
branches/micaSplit/org.maemo.esbox.analysis/src/org/
branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/
branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/
branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/
branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/
branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/Activator.java
branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/adapters/
branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/adapters/AnalysisAdapterFactory.java
branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/adapters/OProfileSupportAdapter.java
branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/adapters/ValgrindSupportAdapter.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/
branches/micaSplit/org.maemo.esbox.maemosdk.tests/.classpath
branches/micaSplit/org.maemo.esbox.maemosdk.tests/.project
branches/micaSplit/org.maemo.esbox.maemosdk.tests/.settings/
branches/micaSplit/org.maemo.esbox.maemosdk.tests/.settings/org.eclipse.jdt.core.prefs
branches/micaSplit/org.maemo.esbox.maemosdk.tests/META-INF/
branches/micaSplit/org.maemo.esbox.maemosdk.tests/META-INF/MANIFEST.MF
branches/micaSplit/org.maemo.esbox.maemosdk.tests/build.properties
branches/micaSplit/org.maemo.esbox.maemosdk.tests/hs_err_pid6120.log
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests/
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests/Activator.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/AllTests.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/ESboxMaemoSDKTestSuite.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/ESboxProductTestSuite.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestOProfileValgrindSupport.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestProcessLauncher.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestRunStandalone.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestSB1ProcessLauncher.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestSB1SDKProvider.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestSB2ProcessLauncher.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestSB2SDKProvider.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/AllTests.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/BaseTest.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/MockCommandAbstractor.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/MockProcessLauncher.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/MockProcessLauncherFactory.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestCreateTargetCommand.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestCreateTargetSb2Command.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestGdbQemuCommand.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestGetCurrentTargetCommand.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestListCommands.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestListSb2Commands.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestRemoveCommand.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestRemoveSb2Command.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestResetTargetCommand.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestRootstrapCommand.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchboxCommand.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchboxFacade.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestSelectTargetCommand.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestShowPathMappingSb2Command.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestShowTargetCommand.java
branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestSimpleCommand.java
branches/micaSplit/org.maemo.esbox.product-feature/
branches/micaSplit/org.maemo.esbox.product-feature/.project
branches/micaSplit/org.maemo.esbox.product-feature/build.properties
branches/micaSplit/org.maemo.esbox.product-feature/feature.xml
branches/micaSplit/org.maemo.esbox.product-feature/license.html
branches/micaSplit/org.maemo.esbox.product-feature/licenses/
branches/micaSplit/org.maemo.esbox.product-feature/licenses/COPYING
branches/micaSplit/org.maemo.esbox.product-feature/licenses/COPYING.LESSER
branches/micaSplit/org.maemo.esbox.product-feature/licenses/epl-v10.html
branches/micaSplit/org.maemo.esbox.product.supplement-feature/
branches/micaSplit/org.maemo.esbox.product.supplement-feature/.project
branches/micaSplit/org.maemo.esbox.product.supplement-feature/build.properties
branches/micaSplit/org.maemo.esbox.product.supplement-feature/feature.xml
branches/micaSplit/org.maemo.esbox.product.supplement-feature/license.html
branches/micaSplit/org.maemo.esbox.product.supplement-feature/licenses/
branches/micaSplit/org.maemo.esbox.product.supplement-feature/licenses/COPYING
branches/micaSplit/org.maemo.esbox.product.supplement-feature/licenses/COPYING.LESSER
branches/micaSplit/org.maemo.esbox.product.supplement-feature/licenses/epl-v10.html
branches/micaSplit/org.maemo.esbox.product.supplement-feature/readme.txt
branches/micaSplit/org.maemo.esbox.product/
branches/micaSplit/org.maemo.esbox.product/.classpath
branches/micaSplit/org.maemo.esbox.product/.project
branches/micaSplit/org.maemo.esbox.product/.settings/
branches/micaSplit/org.maemo.esbox.product/.settings/org.eclipse.jdt.core.prefs
branches/micaSplit/org.maemo.esbox.product/ESbox.product
branches/micaSplit/org.maemo.esbox.product/META-INF/
branches/micaSplit/org.maemo.esbox.product/META-INF/MANIFEST.MF
branches/micaSplit/org.maemo.esbox.product/about.ini
branches/micaSplit/org.maemo.esbox.product/about.mappings
branches/micaSplit/org.maemo.esbox.product/about.properties
branches/micaSplit/org.maemo.esbox.product/build.properties
branches/micaSplit/org.maemo.esbox.product/icons/
branches/micaSplit/org.maemo.esbox.product/icons/esboxIntroPage.gif
branches/micaSplit/org.maemo.esbox.product/icons/esboxIntroPage_hov.gif
branches/micaSplit/org.maemo.esbox.product/icons/esbox_32.png
branches/micaSplit/org.maemo.esbox.product/icons/esbox_48.gif
branches/micaSplit/org.maemo.esbox.product/icons/esbox_48.png
branches/micaSplit/org.maemo.esbox.product/icons/esbox_64.png
branches/micaSplit/org.maemo.esbox.product/icons/maemo_16x16.png
branches/micaSplit/org.maemo.esbox.product/intro-esbox.png
branches/micaSplit/org.maemo.esbox.product/intro/
branches/micaSplit/org.maemo.esbox.product/intro/css/
branches/micaSplit/org.maemo.esbox.product/intro/css/overview.css
branches/micaSplit/org.maemo.esbox.product/intro/css/overview.properties
branches/micaSplit/org.maemo.esbox.product/intro/css/tutorials.css
branches/micaSplit/org.maemo.esbox.product/intro/css/tutorials.properties
branches/micaSplit/org.maemo.esbox.product/intro/css/whatsnew.css
branches/micaSplit/org.maemo.esbox.product/intro/css/whatsnew.properties
branches/micaSplit/org.maemo.esbox.product/intro/overviewExtensionContent.xml
branches/micaSplit/org.maemo.esbox.product/intro/tutorialsExtensionContent.xml
branches/micaSplit/org.maemo.esbox.product/introData.xml
branches/micaSplit/org.maemo.esbox.product/plugin.properties
branches/micaSplit/org.maemo.esbox.product/plugin.xml
branches/micaSplit/org.maemo.esbox.product/plugin_customization.ini
branches/micaSplit/org.maemo.esbox.product/splash.bmp
branches/micaSplit/org.maemo.esbox.product/src/
branches/micaSplit/org.maemo.esbox.product/src/org/
branches/micaSplit/org.maemo.esbox.product/src/org/maemo/
branches/micaSplit/org.maemo.esbox.product/src/org/maemo/esbox/
branches/micaSplit/org.maemo.esbox.product/src/org/maemo/esbox/product/
branches/micaSplit/org.maemo.esbox.product/src/org/maemo/esbox/product/Activator.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/.classpath
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/.project
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/.settings/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/META-INF/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/META-INF/MANIFEST.MF
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/build.properties
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/conf/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/conf/run.sh
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/conf/sb1_prefs.xml
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/plugin.xml
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/Activator.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/AbstractSB1Command.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/CreateTargetCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/GetCurrentTargetCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/GetGdbQemuCommandPatternCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/GetVersionScratchboxCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/KillallCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListCompilersCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListCputranspCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListDevkitsCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListSessionsCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListTargetsCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/RemoveTargetCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ResetTargetCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/RootstrapCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/SelectTargetCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ShowTargetCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/SB1PreferenceConstants.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1FileSystemMapping.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDK.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDKTarget.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1EnvironmentProvider.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1ProcessLauncher.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1ProcessLauncherFactory.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/provider/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/provider/Scratchbox1SDKProvider.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapterFactory.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/preferences/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/preferences/Scratchbox1PreferencesPage.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1TargetWizard.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/TargetWizardDevkitsPage.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/sb1/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/sb1/sdk/
branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/sb1/sdk/IScratchbox1SDK.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/.classpath
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/.project
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/.settings/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/META-INF/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/META-INF/MANIFEST.MF
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/build.properties
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/conf/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/conf/sb2_prefs.xml
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/icons/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/icons/full/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/icons/full/obj16/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/icons/full/obj16/maemoprj_obj.png
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/plugin.xml
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/api/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/api/scratchbox/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/api/scratchbox/sb2/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/api/scratchbox/sb2/core/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/api/scratchbox/sb2/core/SB2PreferenceConstants.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/Activator.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/AbstractSb2Command.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/CreateMaemoRootstrapSb2Command.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/CreateTargetSb2Command.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/GetCurrentTargetSb2Command.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/GetGdbQemuCommandPatternCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/GetMaemoRootstrapLocationCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/GetVersionScratchboxCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListAvailableMaemoRootstrapsSb2Command.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListCompilersSb2Command.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListCputranspSb2Command.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListInstalledMaemoRootstrapsSb2Command.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListTargetsCommand.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/MaemoRootstrapSb2Command.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/RemoveMaemoRootstrapSb2Command.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/RemoveTargetSb2Command.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ShowPathMappingSb2Command.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2FileSystemMapping.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDK.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDKTarget.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/launcher/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/launcher/Scratchbox2EnvironmentProvider.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/launcher/Scratchbox2ProcessLauncher.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/launcher/Scratchbox2ProcessLauncherFactory.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/provider/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/provider/Scratchbox2SDKProvider.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters/MaemoScratchbox2SDKManageTargetAdapter.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters/MaemoScratchbox2SDKManageTargetAdapterFactory.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/preferences/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/preferences/Scratchbox2PreferencesPage.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/MaemoRootstrapContentLabelProvider.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/NewScratchbox2TargetWizard.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/TargetWizardRootstrapSb2Page.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk/
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk/IScratchbox2SDK.java
branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk/MaemoRootstrap.java
Log:
Add the remaining ESbox plugins (!)
Property changes on: branches/micaSplit/org.maemo.esbox.analysis
___________________________________________________________________
Name: svn:ignore
+ bin
Added: branches/micaSplit/org.maemo.esbox.analysis/.classpath
===================================================================
--- branches/micaSplit/org.maemo.esbox.analysis/.classpath (rev 0)
+++ branches/micaSplit/org.maemo.esbox.analysis/.classpath 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: branches/micaSplit/org.maemo.esbox.analysis/.project
===================================================================
--- branches/micaSplit/org.maemo.esbox.analysis/.project (rev 0)
+++ branches/micaSplit/org.maemo.esbox.analysis/.project 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.maemo.esbox.analysis</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: branches/micaSplit/org.maemo.esbox.analysis/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- branches/micaSplit/org.maemo.esbox.analysis/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ branches/micaSplit/org.maemo.esbox.analysis/.settings/org.eclipse.jdt.core.prefs 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,7 @@
+#Fri Oct 17 08:40:13 CDT 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: branches/micaSplit/org.maemo.esbox.analysis/META-INF/MANIFEST.MF
===================================================================
--- branches/micaSplit/org.maemo.esbox.analysis/META-INF/MANIFEST.MF (rev 0)
+++ branches/micaSplit/org.maemo.esbox.analysis/META-INF/MANIFEST.MF 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ESbox Analysis Support Plug-in
+Bundle-SymbolicName: org.maemo.esbox.analysis;singleton:=true
+Bundle-Version: 2.0.0.qualifier
+Bundle-Activator: org.maemo.esbox.internal.analysis.Activator
+Bundle-Vendor: INdT / Nokia
+Require-Bundle: org.eclipse.core.runtime,
+ org.maemo.mica.common.core;bundle-version="2.0.0",
+ org.maemo.mica.maemosdk.core;bundle-version="2.0.0",
+ org.maemo.mica.maemosdk.core;bundle-version="2.0.0",
+ org.maemo.mica.common.analysis;bundle-version="2.0.0",
+ org.maemo.esbox.scratchbox.core;bundle-version="2.0.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
Added: branches/micaSplit/org.maemo.esbox.analysis/build.properties
===================================================================
--- branches/micaSplit/org.maemo.esbox.analysis/build.properties (rev 0)
+++ branches/micaSplit/org.maemo.esbox.analysis/build.properties 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
Added: branches/micaSplit/org.maemo.esbox.analysis/plugin.xml
===================================================================
--- branches/micaSplit/org.maemo.esbox.analysis/plugin.xml (rev 0)
+++ branches/micaSplit/org.maemo.esbox.analysis/plugin.xml 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.core.runtime.adapters">
+ <factory
+ adaptableType="org.maemo.mica.common.core.sdk.ISDKTarget"
+ class="org.maemo.esbox.internal.analysis.adapters.AnalysisAdapterFactory">
+ <adapter
+ type="org.maemo.mica.common.analysis.adapters.IValgrindSupportAdapter">
+ </adapter>
+ <adapter
+ type="org.maemo.mica.common.analysis.adapters.IOProfileSupportAdapter">
+ </adapter>
+ </factory>
+ </extension>
+
+</plugin>
Added: branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/Activator.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/Activator.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/Activator.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,136 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.analysis;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.maemo.mica.common.core.ErrorLogger;
+import org.osgi.framework.BundleContext;
+
+/**
+ * @author eswartz
+ *
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.maemo.mica.maemosdk.analysis";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * @param object
+ * @param e
+ * @return
+ */
+ public static IStatus createErrorStatus(String msg, Throwable t) {
+ return new Status(IStatus.ERROR, PLUGIN_ID, msg, t);
+ }
+
+ /**
+ * @param warning
+ * @param format
+ * @param e
+ * @return
+ */
+ public static IStatus createStatus(int severity, String msg,
+ Throwable t) {
+ return new Status(severity, PLUGIN_ID, msg, t);
+ }
+
+ /**
+ * @param warning
+ * @param string
+ * @return
+ */
+ public static IStatus createStatus(int severity, String string) {
+ return new Status(severity, PLUGIN_ID, string);
+ }
+
+ /**
+ * Return the error logger instance of this plug-in.
+ *
+ * @return the error logger instance of this plug-in.
+ */
+ public static ErrorLogger getErrorLogger() {
+ class CoreErrorLogger extends ErrorLogger {
+
+ @Override
+ public String getPluginID() {
+ return PLUGIN_ID;
+ }
+ @Override
+ public Plugin getPlugin() {
+ return Activator.getDefault();
+ }
+
+ }
+
+ return new CoreErrorLogger();
+ }
+
+ /**
+ * Find a file relative to the plugin, either in a running
+ * workspace or a standalone unit test (assumed to run relative
+ * to a plugin)
+ * @param path
+ */
+ public static InputStream getPluginRelativeInputStream(String path) throws IOException {
+ if (getDefault() != null) {
+ return FileLocator.openStream(getDefault().getBundle(), new Path(path), false);
+ } else {
+ return new FileInputStream("../" + path);
+ }
+ }
+}
Added: branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/adapters/AnalysisAdapterFactory.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/adapters/AnalysisAdapterFactory.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/adapters/AnalysisAdapterFactory.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.analysis.adapters;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+import org.maemo.mica.common.analysis.adapters.IOProfileSupportAdapter;
+import org.maemo.mica.common.analysis.adapters.IValgrindSupportAdapter;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+
+/**
+ * This factory is used to provide the valgrind and oprofile adapters for ISDKTarget.
+ * It is registered via extension point.
+ * @author eswartz
+ *
+ */
+public class AnalysisAdapterFactory implements IAdapterFactory {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+ */
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if (adaptableObject instanceof IScratchboxSDKTarget) {
+ ISDKTarget sdkTarget = (ISDKTarget) adaptableObject;
+ if (adapterType.equals(IValgrindSupportAdapter.class)) {
+ return new ValgrindSupportAdapter(sdkTarget);
+ }
+ if (adapterType.equals(IOProfileSupportAdapter.class)) {
+ return new OProfileSupportAdapter(sdkTarget);
+ }
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
+ */
+ public Class[] getAdapterList() {
+ return new Class[] {
+ IValgrindSupportAdapter.class,
+ IOProfileSupportAdapter.class
+ };
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/adapters/OProfileSupportAdapter.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/adapters/OProfileSupportAdapter.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/adapters/OProfileSupportAdapter.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.analysis.adapters;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.swt.widgets.Shell;
+import org.maemo.mica.common.analysis.adapters.IOProfileSupportAdapter;
+import org.maemo.mica.common.core.machine.IDeviceMachine;
+import org.maemo.mica.common.core.machine.IMachine;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+
+/**
+ * @author eswartz
+ *
+ */
+public class OProfileSupportAdapter implements IOProfileSupportAdapter {
+
+ public OProfileSupportAdapter(ISDKTarget sdkTarget) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.mica.common.analysis.adapters.IOProfileSupport#validateSupport()
+ */
+ public String validateSupport(IMachine machine) {
+ if (!(machine instanceof IDeviceMachine))
+ return "OProfile is only supported on devices.";
+
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.mica.common.analysis.adapters.IOProfileSupport#preLaunchCheck(org.eclipse.swt.widgets.Shell)
+ */
+ public boolean preLaunchCheck(Shell shell) throws CoreException {
+ // TODO: validate the installed packages, etc.
+ return true;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/adapters/ValgrindSupportAdapter.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/adapters/ValgrindSupportAdapter.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.analysis/src/org/maemo/esbox/internal/analysis/adapters/ValgrindSupportAdapter.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.analysis.adapters;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.swt.widgets.Shell;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+import org.maemo.mica.common.analysis.adapters.IValgrindSupportAdapter;
+import org.maemo.mica.common.core.machine.IMachine;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+
+/**
+ * @author eswartz
+ *
+ */
+public class ValgrindSupportAdapter implements IValgrindSupportAdapter {
+
+ private final ISDKTarget sdkTarget;
+ /**
+ * @param sdkTarget
+ */
+ public ValgrindSupportAdapter(ISDKTarget sdkTarget) {
+ this.sdkTarget = sdkTarget;
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.mica.common.analysis.adapters.IValgrindSupport#validateSupport()
+ */
+ public String validateSupport(IMachine machine) {
+ if (sdkTarget.getArchitecture().equals(IScratchboxSDKTarget.ARCHITECTURE_X86)) {
+ return null;
+ }
+ return "valgrind is only supported on x86 targets.";
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.mica.common.analysis.adapters.IValgrindSupport#preLaunchCheck(org.eclipse.swt.widgets.Shell)
+ */
+ public boolean preLaunchCheck(Shell shell) throws CoreException {
+ // TODO: verify that the correct packages are installed, ask to install, etc...
+ return true;
+ }
+
+}
Property changes on: branches/micaSplit/org.maemo.esbox.maemosdk.tests
___________________________________________________________________
Name: svn:ignore
+ bin
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/.classpath
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/.classpath (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/.classpath 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/.project
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/.project (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/.project 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.maemo.esbox.scratchbox.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/.settings/org.eclipse.jdt.core.prefs 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,7 @@
+#Fri Oct 17 08:40:13 CDT 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/META-INF/MANIFEST.MF
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/META-INF/MANIFEST.MF (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/META-INF/MANIFEST.MF 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,33 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ESbox Scratchbox Feature Tests Plug-in
+Bundle-SymbolicName: org.maemo.esbox.scratchbox.tests
+Bundle-Version: 2.0.0.qualifier
+Bundle-Activator: org.maemo.esbox.internal.scratchbox.tests.Activator
+Bundle-Vendor: INdT / Nokia
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.maemo.mica.common.core;bundle-version="2.0.0",
+ org.maemo.mica.common.core.tests;bundle-version="2.0.0",
+ org.maemo.mica.maemosdk.core;bundle-version="2.0.0",
+ org.maemo.mica.maemosdk.ui;bundle-version="2.0.0",
+ org.junit4;bundle-version="4.3.1",
+ org.maemo.mica.cpp.project.core;bundle-version="2.0.0",
+ org.maemo.mica.common.project.core;bundle-version="2.0.0",
+ org.eclipse.cdt.core;bundle-version="5.0.1",
+ org.eclipse.cdt.make.core;bundle-version="5.0.1",
+ org.eclipse.cdt.ui;bundle-version="5.0.1",
+ org.maemo.mica.cpp.project.ui;bundle-version="2.0.0",
+ org.maemo.mica.common.analysis;bundle-version="2.0.0",
+ org.maemo.mica.protocol.ssh;bundle-version="2.0.0",
+ org.maemo.mica.common.launch;bundle-version="2.0.0",
+ org.maemo.mica.cpp.tests;bundle-version="2.0.0",
+ org.maemo.mica.protocol.tests;bundle-version="2.0.0",
+ org.maemo.mica.python.tests;bundle-version="2.0.0",
+ org.maemo.mica.linux.tests;bundle-version="2.0.0",
+ org.maemo.esbox.scratchbox.sb1;bundle-version="2.0.0",
+ org.maemo.esbox.scratchbox.sb2;bundle-version="2.0.0",
+ org.maemo.esbox.scratchbox.core;bundle-version="2.0.0",
+ org.maemo.esbox.maemosdk.core
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/build.properties
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/build.properties (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/build.properties 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/hs_err_pid6120.log
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/hs_err_pid6120.log (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/hs_err_pid6120.log 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,219 @@
+#
+# An unexpected error has been detected by HotSpot Virtual Machine:
+#
+# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d7c76a8, pid=6120, tid=1360
+#
+# Java VM: Java HotSpot(TM) Client VM (1.5.0_12-b04 mixed mode)
+# Problematic frame:
+# V [jvm.dll+0x876a8]
+#
+
+--------------- T H R E A D ---------------
+
+Current thread (0x0c497a20): JavaThread "ErrorReader" daemon [_thread_in_vm, id=1360]
+
+siginfo: ExceptionCode=0xc0000005, writing address 0x10bacac8
+
+Registers:
+EAX=0x00003000, EBX=0x10bafc84, ECX=0x10bacac8, EDX=0x10b76060
+ESP=0x10bafad0, EBP=0x10bafb30, ESI=0x00000003, EDI=0x10bafac8
+EIP=0x6d7c76a8, EFLAGS=0x00010202
+
+Top of Stack: (sp=0x10bafad0)
+0x10bafad0: 0c4b8408 0c497a20 6d7c7551 08c46e60
+0x10bafae0: 0c497a20 0c4b83f8 6d795ec3 00000002
+0x10bafaf0: 6d795e65 0c4b8408 0c4b8408 6d80a2f6
+0x10bafb00: 0c4b8408 0c4b8404 0c497a20 10bafb48
+0x10bafb10: 6d80b5b1 0c4b83fc 0c4b8400 0c4b8404
+0x10bafb20: 0c4b8408 00000007 10bafc8c 00cc89c0
+0x10bafb30: 10bafb74 6d81fbb2 0000000a 00000000
+0x10bafb40: 10bafbe4 0c4b83f8 08c46e60 0c497a20
+
+Instructions: (pc=0x6d7c76a8)
+0x6d7c7698: 89 6d 7c 18 e8 67 73 05 00 0f af c6 8b cf 2b c8
+0x6d7c76a8: 83 21 00 46 3b 35 ac 20 89 6d 7e e8 5f 5e c3 8b
+
+
+Stack: [0x10b70000,0x10bb0000), sp=0x10bafad0, free space=254k
+Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
+V [jvm.dll+0x876a8]
+V [jvm.dll+0xdfbb2]
+V [jvm.dll+0x8746a]
+V [jvm.dll+0x871c7]
+V [jvm.dll+0xa2048]
+V [jvm.dll+0x1110d8]
+V [jvm.dll+0x1110a6]
+C [MSVCRT.dll+0x2a3b0]
+C [kernel32.dll+0xb683]
+
+
+--------------- P R O C E S S ---------------
+
+Java Threads: ( => current thread )
+=>0x0c497a20 JavaThread "ErrorReader" daemon [_thread_in_vm, id=1360]
+ 0x0b9d2008 JavaThread "OutputReader" daemon [_thread_in_vm, id=1928]
+ 0x0c515600 JavaThread "Connect thread 127.0.0.1 session" [_thread_in_native, id=2920]
+ 0x0c47a7f0 JavaThread "ReaderThread" [_thread_in_native, id=3532]
+ 0x0be58a70 JavaThread "Worker-5" [_thread_blocked, id=6100]
+ 0x0be96288 JavaThread "Worker-4" [_thread_in_vm, id=2996]
+ 0x0be58008 JavaThread "Worker-3" [_thread_blocked, id=2388]
+ 0x0be96e60 JavaThread "WorkbenchTestable" [_thread_blocked, id=5580]
+ 0x0bc97c60 JavaThread "Worker-2" [_thread_blocked, id=5460]
+ 0x0bb4d8f8 JavaThread "Worker-1" [_thread_blocked, id=1624]
+ 0x0c3258c0 JavaThread "Java indexing" daemon [_thread_blocked, id=1068]
+ 0x0bc5d028 JavaThread "Worker-0" [_thread_blocked, id=4548]
+ 0x0b272808 JavaThread "Start Level Event Dispatcher" daemon [_thread_blocked, id=3952]
+ 0x0b1e7c78 JavaThread "Framework Event Dispatcher" daemon [_thread_blocked, id=3820]
+ 0x00c91e78 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=5328]
+ 0x00c90c08 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3576]
+ 0x00c90010 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=600]
+ 0x00c8cbb0 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=4696]
+ 0x00c8bec8 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=1088]
+ 0x003887f0 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=2700]
+ 0x00c7c090 JavaThread "Finalizer" daemon [_thread_blocked, id=2036]
+ 0x00c7ac20 JavaThread "Reference Handler" daemon [_thread_blocked, id=4232]
+ 0x00388638 JavaThread "main" [_thread_blocked, id=4380]
+
+Other Threads:
+ 0x00c78158 VMThread [id=2424]
+ 0x00c93838 WatcherThread [id=5724]
+
+VM state:not at safepoint (normal execution)
+
+VM Mutex/Monitor currently owned by a thread: None
+
+Heap
+ def new generation total 3072K, used 410K [0x02cc0000, 0x03010000, 0x031a0000)
+ eden space 2752K, 5% used [0x02cc0000, 0x02ce44b0, 0x02f70000)
+ from space 320K, 82% used [0x02fc0000, 0x030025e8, 0x03010000)
+ to space 320K, 0% used [0x02f70000, 0x02f70000, 0x02fc0000)
+ tenured generation total 39716K, used 22943K [0x031a0000, 0x05869000, 0x06cc0000)
+ the space 39716K, 57% used [0x031a0000, 0x04807e20, 0x04808000, 0x05869000)
+ compacting perm gen total 34560K, used 34441K [0x06cc0000, 0x08e80000, 0x0acc0000)
+ the space 34560K, 99% used [0x06cc0000, 0x08e626a8, 0x08e62800, 0x08e80000)
+No shared spaces configured.
+
+Dynamic libraries:
+0x00400000 - 0x0040d000 C:\Program Files\Java\jdk1.5.0_12\jre\bin\javaw.exe
+0x7c900000 - 0x7c9b0000 C:\WINNT\system32\ntdll.dll
+0x7c800000 - 0x7c8f5000 C:\WINNT\system32\kernel32.dll
+0x77dd0000 - 0x77e6b000 C:\WINNT\system32\ADVAPI32.dll
+0x77e70000 - 0x77f02000 C:\WINNT\system32\RPCRT4.dll
+0x77fe0000 - 0x77ff1000 C:\WINNT\system32\Secur32.dll
+0x7e410000 - 0x7e4a0000 C:\WINNT\system32\USER32.dll
+0x77f10000 - 0x77f57000 C:\WINNT\system32\GDI32.dll
+0x77c10000 - 0x77c68000 C:\WINNT\system32\MSVCRT.dll
+0x10000000 - 0x1003e000 C:\WINNT\system32\cahooknt.dll
+0x6d740000 - 0x6d8dd000 C:\Program Files\Java\jdk1.5.0_12\jre\bin\client\jvm.dll
+0x76b40000 - 0x76b6d000 C:\WINNT\system32\WINMM.dll
+0x6d300000 - 0x6d308000 C:\Program Files\Java\jdk1.5.0_12\jre\bin\hpi.dll
+0x76bf0000 - 0x76bfb000 C:\WINNT\system32\PSAPI.DLL
+0x6d400000 - 0x6d435000 C:\Program Files\Java\jdk1.5.0_12\jre\bin\jdwp.dll
+0x6d710000 - 0x6d71c000 C:\Program Files\Java\jdk1.5.0_12\jre\bin\verify.dll
+0x6d380000 - 0x6d39d000 C:\Program Files\Java\jdk1.5.0_12\jre\bin\java.dll
+0x6d730000 - 0x6d73f000 C:\Program Files\Java\jdk1.5.0_12\jre\bin\zip.dll
+0x6d290000 - 0x6d297000 C:\Program Files\Java\jdk1.5.0_12\jre\bin\dt_socket.dll
+0x71ab0000 - 0x71ac7000 C:\WINNT\system32\WS2_32.dll
+0x71aa0000 - 0x71aa8000 C:\WINNT\system32\WS2HELP.dll
+0x751d0000 - 0x751ee000 C:\WINNT\system32\wshbth.dll
+0x77920000 - 0x77a13000 C:\WINNT\system32\SETUPAPI.dll
+0x71a50000 - 0x71a8f000 C:\WINNT\System32\mswsock.dll
+0x76f20000 - 0x76f47000 C:\WINNT\system32\DNSAPI.dll
+0x76fb0000 - 0x76fb8000 C:\WINNT\System32\winrnr.dll
+0x76f60000 - 0x76f8c000 C:\WINNT\system32\WLDAP32.dll
+0x76fc0000 - 0x76fc6000 C:\WINNT\system32\rasadhlp.dll
+0x662b0000 - 0x66308000 C:\WINNT\system32\hnetcfg.dll
+0x71a90000 - 0x71a98000 C:\WINNT\System32\wshtcpip.dll
+0x6d540000 - 0x6d553000 C:\Program Files\Java\jdk1.5.0_12\jre\bin\net.dll
+0x6d560000 - 0x6d569000 C:\Program Files\Java\jdk1.5.0_12\jre\bin\nio.dll
+0x72000000 - 0x72014000 C:\eclipse-3.4.1\eclipse\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\eclipse_1115.dll
+0x5d090000 - 0x5d12a000 C:\WINNT\system32\COMCTL32.dll
+0x77c00000 - 0x77c08000 C:\WINNT\system32\VERSION.dll
+0x0ce80000 - 0x0ced5000 C:\sources\maemo-eclipse\.metadata\.plugins\org.eclipse.pde.core\pde-junit\org.eclipse.osgi\bundles\101\1\.cp\swt-win32-3449.dll
+0x774e0000 - 0x7761d000 C:\WINNT\system32\ole32.dll
+0x77120000 - 0x771ab000 C:\WINNT\system32\OLEAUT32.dll
+0x763b0000 - 0x763f9000 C:\WINNT\system32\comdlg32.dll
+0x77f60000 - 0x77fd6000 C:\WINNT\system32\SHLWAPI.dll
+0x773d0000 - 0x774d3000 C:\WINNT\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\COMCTL32.dll
+0x7c9c0000 - 0x7d1d7000 C:\WINNT\system32\SHELL32.dll
+0x76390000 - 0x763ad000 C:\WINNT\system32\IMM32.dll
+0x74d90000 - 0x74dfb000 C:\WINNT\system32\USP10.dll
+0x771b0000 - 0x7725a000 C:\WINNT\system32\WININET.dll
+0x77a80000 - 0x77b14000 C:\WINNT\system32\CRYPT32.dll
+0x77b20000 - 0x77b32000 C:\WINNT\system32\MSASN1.dll
+0x5ad70000 - 0x5ada8000 C:\WINNT\system32\uxtheme.dll
+0x74720000 - 0x7476b000 C:\WINNT\system32\MSCTF.dll
+0x63000000 - 0x63014000 C:\WINNT\system32\SynTPFcs.dll
+0x0d520000 - 0x0d534000 C:\sources\maemo-eclipse\.metadata\.plugins\org.eclipse.pde.core\pde-junit\org.eclipse.osgi\bundles\101\1\.cp\swt-gdip-win32-3449.dll
+0x4ec50000 - 0x4edf6000 C:\WINNT\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.2600.3352_x-ww_81af8e88\gdiplus.dll
+0x74c80000 - 0x74cac000 C:\WINNT\system32\oleacc.dll
+0x76080000 - 0x760e5000 C:\WINNT\system32\MSVCP60.dll
+0x20000000 - 0x202c5000 C:\WINNT\system32\xpsp2res.dll
+0x76fd0000 - 0x7704f000 C:\WINNT\system32\CLBCATQ.DLL
+0x77050000 - 0x77115000 C:\WINNT\system32\COMRes.dll
+0x7e290000 - 0x7e401000 C:\WINNT\system32\shdocvw.dll
+0x754d0000 - 0x75550000 C:\WINNT\system32\CRYPTUI.dll
+0x76c30000 - 0x76c5e000 C:\WINNT\system32\WINTRUST.dll
+0x76c90000 - 0x76cb8000 C:\WINNT\system32\IMAGEHLP.dll
+0x5b860000 - 0x5b8b4000 C:\WINNT\system32\NETAPI32.dll
+0x77b40000 - 0x77b62000 C:\WINNT\system32\appHelp.dll
+0x75e90000 - 0x75f40000 C:\WINNT\system32\SXS.DLL
+0x0e450000 - 0x0e716000 C:\WINNT\system32\msi.dll
+0x7e1e0000 - 0x7e282000 C:\WINNT\system32\urlmon.dll
+0x0e780000 - 0x0e808000 C:\WINNT\system32\shdoclc.dll
+0x7dc30000 - 0x7df23000 C:\WINNT\system32\mshtml.dll
+0x746c0000 - 0x746e7000 C:\WINNT\system32\msls31.dll
+0x75cf0000 - 0x75d81000 C:\WINNT\system32\MLANG.dll
+0x76380000 - 0x76385000 C:\WINNT\system32\msimg32.dll
+0x746f0000 - 0x7471a000 C:\WINNT\system32\msimtf.dll
+0x75c50000 - 0x75cbf000 C:\WINNT\system32\jscript.dll
+0x6bdd0000 - 0x6be06000 C:\WINNT\system32\dxtrans.dll
+0x76b20000 - 0x76b31000 C:\WINNT\system32\ATL.DLL
+0x0f8e0000 - 0x0f8ea000 C:\WINNT\system32\ddrawex.dll
+0x73760000 - 0x737a9000 C:\WINNT\system32\DDRAW.dll
+0x73bc0000 - 0x73bc6000 C:\WINNT\system32\DCIMAN32.dll
+0x6be10000 - 0x6be6a000 C:\WINNT\system32\dxtmsft.dll
+0x66880000 - 0x6688c000 C:\WINNT\system32\IMGUTIL.DLL
+0x5e310000 - 0x5e31c000 C:\WINNT\system32\pngfilt.dll
+0x0fea0000 - 0x0feaf000 C:\sources\maemo-eclipse\.metadata\.plugins\org.eclipse.pde.core\pde-junit\org.eclipse.osgi\bundles\149\1\.cp\jWinHttp.dll
+0x4d4f0000 - 0x4d548000 C:\WINNT\system32\WINHTTP.dll
+0x104f0000 - 0x10518000 C:\WINNT\system32\rsaenh.dll
+0x769c0000 - 0x76a73000 C:\WINNT\system32\USERENV.dll
+0x0b5c0000 - 0x0b5c8000 C:\sources\maemo-eclipse\.metadata\.plugins\org.eclipse.pde.core\pde-junit\org.eclipse.osgi\bundles\83\1\.cp\os\win32\x86\localfile_1_0_0.dll
+0x6eec0000 - 0x6eee1000 C:\eclipse-3.4.1\eclipse\plugins\org.tigris.subversion.clientadapter.javahl.win32_1.5.3\libapr-1.dll
+0x106d0000 - 0x107da000 C:\eclipse-3.4.1\eclipse\plugins\org.tigris.subversion.clientadapter.javahl.win32_1.5.3\libeay32.dll
+0x71ad0000 - 0x71ad9000 C:\WINNT\system32\WSOCK32.dll
+0x13000000 - 0x130c4000 C:\eclipse-3.4.1\eclipse\plugins\org.tigris.subversion.clientadapter.javahl.win32_1.5.3\libdb44.dll
+0x10670000 - 0x106a1000 C:\eclipse-3.4.1\eclipse\plugins\org.tigris.subversion.clientadapter.javahl.win32_1.5.3\ssleay32.dll
+0x6ee60000 - 0x6ee8a000 C:\eclipse-3.4.1\eclipse\plugins\org.tigris.subversion.clientadapter.javahl.win32_1.5.3\libaprutil-1.dll
+0x107e0000 - 0x107f2000 C:\eclipse-3.4.1\eclipse\plugins\org.tigris.subversion.clientadapter.javahl.win32_1.5.3\intl3_svn.dll
+0x10800000 - 0x10915000 C:\eclipse-3.4.1\eclipse\plugins\org.tigris.subversion.clientadapter.javahl.win32_1.5.3\dbghelp.dll
+0x10a20000 - 0x10a72000 C:\eclipse-3.4.1\eclipse\plugins\org.tigris.subversion.clientadapter.javahl.win32_1.5.3\libsvn_subr-1.dll
+0x76780000 - 0x76789000 C:\WINNT\system32\SHFOLDER.dll
+0x10a80000 - 0x10a96000 C:\eclipse-3.4.1\eclipse\plugins\org.tigris.subversion.clientadapter.javahl.win32_1.5.3\libsvn_delta-1.dll
+0x10aa0000 - 0x10aad000 C:\eclipse-3.4.1\eclipse\plugins\org.tigris.subversion.clientadapter.javahl.win32_1.5.3\libsvn_diff-1.dll
+
+VM Arguments:
+jvm_args: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:1101 -Declipse.pde.launch=true -Declipse.p2.data.area=@config.dir\p2 -Dfile.encoding=Cp1252
+java_command: org.eclipse.equinox.launcher.Main -os win32 -ws win32 -arch x86 -nl en_US -version 3 -port 1100 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -classNames org.maemo.esbox.scratchbox.tests.ESboxProductTestSuite -application org.eclipse.pde.junit.runtime.uitestapplication -product org.eclipse.sdk.ide -data C:\sources\maemo-eclipse/../junit-workspace -configuration file:C:/sources/maemo-eclipse/.metadata/.plugins/org.eclipse.pde.core/pde-junit/ -dev file:C:/sources/maemo-eclipse/.metadata/.plugins/org.eclipse.pde.core/pde-junit/dev.properties -os win32 -ws win32 -arch x86 -nl en_US -testpluginname org.maemo.esbox.scratchbox.tests
+Launcher Type: SUN_STANDARD
+
+Environment Variables:
+CLASSPATH=.;C:\Program Files\Java\jre1.6.0_03\lib\ext\QTJava.zip
+PATH=C:\Program Files\Java\jdk1.5.0_12\jre\bin;C:/Program Files/Java/jre1.6.0_03/bin/client;C:/Program Files/Java/jre1.6.0_03/bin;C:\Program Files\Common Files\Symbian\Tools;C:\Program Files\PC Connectivity Solution\;c:\apps\rvct22_616\bin;4.553193E+219POCROOT4.556791e+219poc32\tools;9.080440E-315POCROOT3.931419e+219poc32\gcc\bin;C:\Perl\bin\;C:\Program Files\ThinkPad\Utilities;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;c:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\Intel\Wireless\Bin;C:\Program Files\Common Files\GTK\2.0\bin;C:\Program Files\Nokia\CodeWarrior for Symbian v3.1\Bin;C:\Symbian\UIQ3.1SDK\epoc32\tools\nokia_compiler\Symbian_Tools\Command_Line_Tools;C:\PROGRA~1\PuTTY;C:\Program Files\QuickTime\QTSystem\;
+USERNAME=eswartz
+OS=Windows_NT
+PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 6, GenuineIntel
+
+
+
+--------------- S Y S T E M ---------------
+
+OS: Windows XP Build 2600 Service Pack 2
+
+CPU:total 2 (cores per cpu 2, threads per core 1) family 6 model 15 stepping 6, cmov, cx8, fxsr, mmx, sse, sse2
+
+Memory: 4k page, physical 2095448k(360176k free), swap 1942156k(5192k free)
+
+vm_info: Java HotSpot(TM) Client VM (1.5.0_12-b04) for windows-x86, built on May 2 2007 02:07:59 by "java_re" with MS VC++ 6.0
+
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests/Activator.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests/Activator.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests/Activator.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,50 @@
+package org.maemo.esbox.internal.scratchbox.tests;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.maemo.esbox.scratchbox.tests";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/AllTests.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/AllTests.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/AllTests.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.scratchbox.tests;
+
+import junit.framework.*;
+
+/**
+ * @author eswartz
+ *
+ */
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(
+ "Test for org.maemo.esbox.scratchbox.tests");
+ suite.addTest(new JUnit4TestAdapter(TestOProfileValgrindSupport.class));
+ //$JUnit-BEGIN$
+ suite.addTestSuite(TestSB2ProcessLauncher.class);
+ suite.addTestSuite(TestSB1ProcessLauncher.class);
+ suite.addTestSuite(TestSB2SDKProvider.class);
+ suite.addTestSuite(TestProcessLauncher.class);
+ suite.addTestSuite(TestSB1SDKProvider.class);
+ //$JUnit-END$
+ return suite;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/ESboxMaemoSDKTestSuite.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/ESboxMaemoSDKTestSuite.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/ESboxMaemoSDKTestSuite.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.scratchbox.tests;
+
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @author eswartz
+ *
+ */
+public class ESboxMaemoSDKTestSuite {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(
+ "Test for org.maemo.esbox.internal.scratchbox.tests");
+
+ suite.addTest(org.maemo.esbox.scratchbox.tests.AllTests.suite());
+ suite.addTest(org.maemo.esbox.scratchbox.tests.commands.AllTests.suite());
+ //$JUnit-BEGIN$
+
+ //$JUnit-END$
+ return suite;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/ESboxProductTestSuite.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/ESboxProductTestSuite.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/ESboxProductTestSuite.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.scratchbox.tests;
+
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.machine.*;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * We place this suite here since the maemo SDK tests usually depend on
+ * most of these other features anyway. (The alternative is to make a new
+ * org.maemo.esbox.product.tests plugin.)
+ * @author eswartz
+ *
+ */
+public class ESboxProductTestSuite {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(
+ "Test for ESbox Product");
+
+ for (IBuildMachine machine : MachineRegistry.getInstance().getBuildMachines()) {
+ try {
+ MachineUtils.acquireMachine(machine);
+ } catch (ESboxException e) {
+ }
+ }
+
+ suite.addTest(org.maemo.mica.common.core.tests.ESboxCoreTestSuite.suite());
+ suite.addTest(org.maemo.esbox.scratchbox.tests.ESboxMaemoSDKTestSuite.suite());
+ suite.addTest(org.maemo.mica.linux.tests.ESboxLinuxTestSuite.suite());
+ suite.addTest(org.maemo.mica.cpp.tests.ESboxCppTestSuite.suite());
+ suite.addTest(org.maemo.mica.python.tests.ESboxPythonTestSuite.suite());
+ suite.addTest(org.maemo.mica.protocol.tests.ESboxDeviceTestSuite.suite());
+ //$JUnit-BEGIN$
+
+ //$JUnit-END$
+ return suite;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestOProfileValgrindSupport.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestOProfileValgrindSupport.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestOProfileValgrindSupport.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.scratchbox.tests;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import org.junit.Test;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+import org.maemo.esbox.scratchbox.core.sdk.ScratchboxSDKFacade;
+import org.maemo.mica.common.analysis.adapters.IOProfileSupportAdapter;
+import org.maemo.mica.common.analysis.adapters.IValgrindSupportAdapter;
+import org.maemo.mica.common.core.machine.IMachine;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.internal.api.protocol.ssh.DeviceSSHLinuxMachine;
+import org.maemo.mica.protocol.ssh.SSHConfiguration;
+
+
+/**
+ * Test that the OProfile and Valgrind adapter support is wired up properly.
+ * @author eswartz
+ *
+ */
+public class TestOProfileValgrindSupport {
+ @Test
+ public void testSbox() throws Exception {
+
+ ISDKTarget armelTarget = null;
+
+ for (ISDKTarget sdkTarget : ScratchboxSDKFacade.getInstance().getScratchboxSDKTargets()) {
+ IOProfileSupportAdapter oprofileSupport = (IOProfileSupportAdapter) sdkTarget.getAdapter(IOProfileSupportAdapter.class);
+ IValgrindSupportAdapter valgrindSupportAdapter = (IValgrindSupportAdapter) sdkTarget.getAdapter(IValgrindSupportAdapter.class);
+ if (sdkTarget.getPlatform().getName().toLowerCase().matches("chinook|diablo|fremantle")) {
+ assertNotNull(sdkTarget.getName(), oprofileSupport);
+ assertNotNull(sdkTarget.getName(), valgrindSupportAdapter);
+
+ IMachine machine = sdkTarget.getSDK().getMachine();
+ if (sdkTarget.getArchitecture().equals(IScratchboxSDKTarget.ARCHITECTURE_ARMEL)) {
+ armelTarget = sdkTarget;
+ assertNotNull(oprofileSupport.validateSupport(machine)); // not a device
+ assertNotNull(valgrindSupportAdapter.validateSupport(machine)); // no ARMEL port of valgrind known
+ } else if (sdkTarget.getArchitecture().equals(IScratchboxSDKTarget.ARCHITECTURE_X86)) {
+ assertNotNull(oprofileSupport.validateSupport(machine)); // not a device
+ assertNull(valgrindSupportAdapter.validateSupport(machine));
+ }
+ }
+ }
+
+ if (armelTarget != null) {
+ SSHConfiguration sshConfig = new SSHConfiguration();
+ IMachine machine = new DeviceSSHLinuxMachine("foo", sshConfig, null);
+
+ IOProfileSupportAdapter oprofileSupport = (IOProfileSupportAdapter) armelTarget.getAdapter(IOProfileSupportAdapter.class);
+ IValgrindSupportAdapter valgrindSupportAdapter = (IValgrindSupportAdapter) armelTarget.getAdapter(IValgrindSupportAdapter.class);
+
+ assertNotNull(oprofileSupport);
+ assertNotNull(valgrindSupportAdapter);
+
+ assertNotNull(valgrindSupportAdapter.validateSupport(machine)); // no ARMEL port of valgrind known
+ assertNull(oprofileSupport.validateSupport(machine)); // device launch
+ }
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestProcessLauncher.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestProcessLauncher.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestProcessLauncher.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,454 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.filesystem.provider.FileInfo;
+import org.eclipse.core.runtime.*;
+import org.junit.Test;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.env.EnvironmentManager;
+import org.maemo.mica.common.core.env.IEnvironmentModifierBlock;
+import org.maemo.mica.common.core.machine.IMachine;
+import org.maemo.mica.common.core.machine.MachineRegistry;
+import org.maemo.mica.common.core.process.*;
+import org.maemo.mica.common.core.sdk.ISDK;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.common.core.tests.core.BaseTest;
+import org.maemo.mica.internal.api.common.core.sdk.HostSDK;
+
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Test the generic IProcessLauncher interface.
+ * This test is extended by SDK-specific tests which override
+ * #getSDKs() to test these basic tests on different SDKs.
+ * @author eswartz
+ *
+ */
+public class TestProcessLauncher extends BaseTest {
+
+ private static final int MAX_TARGETS = 2;
+ private Process theProcess;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ protected List<ISDK> getSDKs() throws ESboxException {
+ ArrayList<ISDK> sdks = new ArrayList<ISDK>();
+ for (IMachine machine : MachineRegistry.getInstance().getBuildMachines()) {
+ if (machine.getOS().equals(Platform.OS_LINUX))
+ sdks.add(new HostSDK(machine, "1.0.0", machine.getName()));
+ }
+ return sdks;
+ }
+
+ protected interface IRunner {
+ void run(ISDKTarget target) throws Exception;
+ }
+
+ protected void runOverTargets(IRunner runner) throws Exception {
+ boolean any = false;
+ for (ISDK sdk : getSDKs()) {
+ int count = MAX_TARGETS;
+ ISDKTarget[] targets = sdk.getSDKTargets();
+ for (ISDKTarget target : targets) {
+ if (target.getName().contains("libtool")
+ || target.getName().contains("REMOVE")
+ || target.getName().contains("bora"))
+ continue;
+ if (!validateMachine(target.getSDK().getMachine()))
+ continue;
+ if (--count < 0)
+ break;
+ any = true;
+ runner.run(target);
+ }
+ }
+ assertTrue("No SDK targets found", any);
+
+ }
+
+ /** Make sure env vars are actually passed appropriately */
+ @Test
+ public void testEnvVars() throws Exception {
+ runOverTargets(new IRunner() {
+
+ public void run(ISDKTarget target) throws Exception {
+
+ String cmdText = "echo $CC $LDFLAGS =$SPACEY= \"$LAST\" $LANG$MAIL$IFS .";
+ IEnvironmentModifierBlock envVarBlock = EnvironmentManager.getInstance().createEnvironmentModifierBlock();
+ envVarBlock.define("CC", "gcc");
+ envVarBlock.define("LDFLAGS", "-lm");
+ envVarBlock.define("SPACEY", "-a -b larry's -d"); // the ' should not cause a problem
+ envVarBlock.define("LAST", "*"); // this should not be expanded
+ envVarBlock.undefine("LANG");
+ envVarBlock.undefine("MAIL");
+ envVarBlock.undefine("IFS");
+
+ IProcessLauncher processLauncher = createAndLaunchStockProcessForScript(
+ target, null, cmdText, envVarBlock);
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ByteArrayOutputStream err = new ByteArrayOutputStream();
+ int exit = processLauncher.waitAndRead(out, err);
+ assertEquals(target.getName() + ": " + err.toString(), 0, exit); // some targets can't handle export $@
+ assertEquals("", err.toString());
+ assertStdTextEquals("gcc -lm =-a -b larry's -d= * .\n", out.toString());
+ }
+
+ });
+ }
+
+ /** Make sure env vars are not lost entirely when passing null envBlock */
+ @Test
+ public void testEnvVars2() throws Exception {
+ runOverTargets(new IRunner() {
+
+ public void run(ISDKTarget target) throws Exception {
+
+ String cmdText = "echo $PATH";
+ IProcessLauncher processLauncher = createAndLaunchStockProcessForScript(
+ target, null, cmdText, null);
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ByteArrayOutputStream err = new ByteArrayOutputStream();
+ int exit = processLauncher.waitAndRead(out, err);
+ assertEquals(target+":\n"+err.toString(), 0, exit);
+
+ assertEquals("", err.toString());
+ assertTrue(out.toString().contains(":"));
+ }
+
+ });
+ }
+ /** Test launching and consuming output */
+ @Test
+ public void testStreamParsing() throws Exception {
+ runOverTargets(new IRunner() {
+
+ public void run(ISDKTarget target) throws Exception {
+ String cmdText = "echo stdout1 ; echo stderr1 1>&2 ; "
+ + "echo stdout2 ; echo stderr2 1>&2 ; "
+ + "echo stdout3 ; echo stderr3 1>&2 ; "
+ + "echo stdout4 ; echo stderr4 1>&2 ; " + "";
+ IProcessLauncher processLauncher = createAndLaunchStockProcessForScript(
+ target, null, cmdText, null);
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ByteArrayOutputStream err = new ByteArrayOutputStream();
+ int exit = processLauncher.waitAndRead(out, err);
+ assertEquals(target+":\n"+err.toString(), 0, exit);
+
+ assertStdTextEquals("stderr1\nstderr2\nstderr3\nstderr4\n", err
+ .toString());
+ assertStdTextEquals("stdout1\nstdout2\nstdout3\nstdout4\n", out
+ .toString());
+
+ }
+ });
+ }
+
+ /** Make sure the stream I/O works */
+ @Test
+ public void testStreamHandling2() throws Exception {
+ runOverTargets(new IRunner() {
+
+ public void run(ISDKTarget target) throws Exception {
+ String cmdText = "sed s/from/to/g";
+
+ IProcessLauncher processLauncher = createAndLaunchStockProcessForScript(
+ target, null, cmdText, null);
+
+ theProcess.getOutputStream().write("this is from home\nwhere is it from?\n".getBytes());
+ theProcess.getOutputStream().close();
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ByteArrayOutputStream err = new ByteArrayOutputStream();
+ int exit = processLauncher.waitAndRead(out, err);
+ assertEquals(0, exit);
+
+ // some sdks don't have sed
+ if (!err.toString().contains("command not found")) {
+ assertEquals("", err.toString());
+ assertStdTextEquals("this is to home\nwhere is it to?\n", out.toString());
+ }
+
+ }
+ });
+
+ }
+ /**
+ * @param target SDK target to use
+ * @param cwd target-relative CWD or null
+ * @param cmdText text to copy into script
+ * @param envVarBlock environment variables
+ * @param pty pty or null
+ * @return new process launcher
+ */
+ IProcessLauncher createAndLaunchStockProcessForScript(
+ ISDKTarget target, IPath cwd, String cmdText, IEnvironmentModifierBlock envVarBlock)
+ throws Exception {
+ IProcessLauncherFactory processLauncherFactory = target
+ .getProcessLauncherFactory();
+
+ return createAndLaunchStockProcessForScript(
+ processLauncherFactory,
+ target, cwd, cmdText,
+ envVarBlock);
+ }
+
+ IProcessLauncher createAndLaunchStockProcessForScript(IProcessLauncherFactory processLauncherFactory,
+ ISDKTarget target, IPath cwd, String cmdText, IEnvironmentModifierBlock envVarBlock)
+ throws Exception {
+ IPath scriptPath = createStockScript(target, cmdText);
+
+ // System.out.println(cmdline);
+ List<String> cmdLine = CommandLineArguments.createFromCommandLine(scriptPath.toPortableString());
+ IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(
+ processLauncherFactory, cwd,
+ CommandLineArguments.wrapScriptCommandLineForShell(cmdLine),
+ envVarBlock);
+ // System.out.println(processLauncher.getLaunchCommandArguments().toCommandLine());
+
+ theProcess = processLauncher.createProcess();
+ return processLauncher;
+ }
+
+ private IPath createStockScript(ISDKTarget target, String cmdText)
+ throws Exception {
+
+ IPath scriptPath = target.getSDK().getMachine().getUserHome().append(".tmp").append("foo.sh");
+ IPath targetPath = target.getMachineToSDKTargetFileSystemMapping().convertTargetToHostPath(scriptPath);
+ target.getTargetFileSystemAccess().getFileStore(targetPath.removeLastSegments(1)).mkdir(0, null);
+
+ IFileStore fileStore = target.getTargetFileSystemAccess().getFileStore(targetPath);
+ OutputStream fos = fileStore.openOutputStream(
+ EFS.NONE, new NullProgressMonitor());
+ fos.write(("#!/bin/sh\n" + cmdText).getBytes());
+ fos.close();
+
+ FileInfo info = new FileInfo(fileStore.getName());
+ info.setAttribute(EFS.ATTRIBUTE_EXECUTABLE, true);
+ fileStore.putInfo(info, EFS.SET_ATTRIBUTES, null);
+
+ return scriptPath;
+ }
+
+ /** Test launching and failing */
+ @Test
+ public void testFailure() throws Exception {
+ runOverTargets(new IRunner() {
+
+ public void run(ISDKTarget target) throws Exception {
+ IProcessLauncherFactory processLauncherFactory = target
+ .getProcessLauncherFactory();
+ IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(processLauncherFactory, "/non/existent/program -i -c -e");
+
+ // depending on the level of SDK, we may either get an exception
+ // or a process which fails
+ try {
+ Process process = processLauncher.createProcess();
+ processLauncher.waitAndRead(new ByteArrayOutputStream(),
+ new ByteArrayOutputStream());
+ int exit = process.exitValue();
+ assertTrue(exit != 0);
+ } catch (ESboxException e) {
+ // expected
+ }
+ }
+ });
+ }
+
+ /** Test launching and succeeding with a bad exit code */
+ @Test
+ public void testNonZeroExit() throws Exception {
+ runOverTargets(new IRunner() {
+
+ public void run(ISDKTarget target) throws Exception {
+ IProcessLauncherFactory processLauncherFactory = target
+ .getProcessLauncherFactory();
+ IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(processLauncherFactory, "false");
+
+ Process process = processLauncher.createProcess();
+ processLauncher.waitAndRead(new ByteArrayOutputStream(),
+ new ByteArrayOutputStream());
+ int exit = process.exitValue();
+ assertEquals(1, exit);
+ }
+ });
+ }
+
+ /** Make sure the cwd is actually passed appropriately */
+ @Test
+ public void testCWD() throws Exception {
+ runOverTargets(new IRunner() {
+
+ public void run(ISDKTarget target) throws Exception {
+ String cmdText = "pwd";
+
+ IProcessLauncher processLauncher = createAndLaunchStockProcessForScript(
+ target, new Path("/usr/games"), cmdText, null);
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ByteArrayOutputStream err = new ByteArrayOutputStream();
+ int exit = processLauncher.waitAndRead(out, err);
+ assertEquals(target+":\n"+err.toString(), 0, exit);
+
+ assertStdTextEquals("", err.toString());
+ assertEquals(target.getName(), "/usr/games", out.toString().trim());
+
+ }
+ });
+ }
+
+ /** Make sure the PTY variant works */
+ @Test
+ public void testPTY() throws Exception {
+ runOverTargets(new IRunner() {
+
+ public void run(ISDKTarget target) throws Exception {
+ String cmdText = "sed s/from/to/g";
+
+ IProcessLauncher processLauncher = createAndLaunchStockProcessForScript(
+ target, null, cmdText, null);
+
+ theProcess.getOutputStream().write("this is from home\nwhere is it from?\n".getBytes());
+ theProcess.getOutputStream().close();
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ByteArrayOutputStream err = new ByteArrayOutputStream();
+ int exit = processLauncher.waitAndRead(out, err);
+ assertEquals(target+":\n"+err.toString(), 0, exit);
+
+ // some sdks don't have sed
+ if (!err.toString().contains("command not found")) {
+ assertStdTextEquals("", err.toString());
+ assertStdTextEquals("this is to home\nwhere is it to?", out.toString().trim());
+ }
+
+ }
+ });
+
+ }
+
+ /** Test that the Esbox environment variables are passed properly */
+ @Test
+ public void testEnvironmentDefaults() throws Exception {
+ runOverTargets(new IRunner() {
+
+ public void run(ISDKTarget target) throws Exception {
+ IEnvironmentModifierBlock globalBlock = EnvironmentManager.getInstance().getGlobalEnvironmentModifierBlock();
+ IEnvironmentModifierBlock envBlockOrig = globalBlock.copy();
+
+ try {
+ // DISPLAY comes from the .bashrc in scratchbox or from the X11 environment
+ globalBlock.clear();
+
+ // set ESbox variables
+ globalBlock.define("ESBOXONLY", "fromesbox_original");
+ globalBlock.define("ESBOXOVERRIDE", "fromesbox_original");
+ globalBlock.define("DISPLAY", "esbox:3");
+
+ // construct an environment that consists of overrides of the standard environment
+ IProcessLauncherFactory factory = target.getProcessLauncherFactory();
+ IEnvironmentModifierBlock envVarBlock = factory.defaultEnvironmentModifierBlock();
+
+ assertNotNull(envVarBlock.findOperation("ESBOXONLY"));
+ assertNotNull(envVarBlock.findOperation("ESBOXOVERRIDE"));
+ assertNotNull(envVarBlock.findOperation("DISPLAY"));
+
+ envVarBlock.define("ESBOXOVERRIDE", "launch_override");
+ envVarBlock.define("PASSEDIN", "launch_passedin");
+
+ String cmdText = "echo $DISPLAY,$ESBOXONLY,$ESBOXOVERRIDE,$PASSEDIN\necho $USER\n";
+ IProcessLauncher processLauncher = createAndLaunchStockProcessForScript(
+ factory, target, null, cmdText, envVarBlock);
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ByteArrayOutputStream err = new ByteArrayOutputStream();
+ int exit = processLauncher.waitAndRead(out, err);
+ assertEquals(target+":\n"+err.toString(), 0, exit);
+
+ assertStdTextEquals("", err.toString());
+ String[] lines = out.toString().trim().split("\r\n|\n");
+ assertEquals("esbox:3,fromesbox_original,launch_override,launch_passedin", lines[0]);
+ assertEquals(2, lines.length);
+ assertTrue(lines.length > 0);
+
+ //////////
+
+ // construct an environment that consists of a clean environment
+ envVarBlock = EnvironmentManager.getInstance().createEnvironmentModifierBlock();
+ envVarBlock.define("ESBOXOVERRIDE", "launch_override");
+ envVarBlock.define("PASSEDIN", "launch_passedin");
+
+ cmdText = "echo $ESBOXONLY,$ESBOXOVERRIDE,$PASSEDIN";
+ processLauncher = createAndLaunchStockProcessForScript(
+ target, null, cmdText, envVarBlock);
+
+ out = new ByteArrayOutputStream();
+ err = new ByteArrayOutputStream();
+ exit = processLauncher.waitAndRead(out, err);
+ assertEquals(target+":\n"+err.toString(), 0, exit);
+
+ assertEquals("", err.toString());
+ assertStdTextEquals(",launch_override,launch_passedin\n", out.toString());
+ } finally {
+ EnvironmentManager.getInstance().getGlobalEnvironmentModifierBlock().clear();
+ EnvironmentManager.getInstance().getGlobalEnvironmentModifierBlock().apply(envBlockOrig);
+ }
+ }
+ });
+ }
+
+ /**
+ * If a process is launched with a different PATH, we must ensure to wrap the
+ * command in a shell, or else PATH won't be used.
+ * @throws Exception
+ */
+ public void testLaunchWithAlternatePATH() throws Exception {
+ runOverTargets(new IRunner() {
+
+ public void run(ISDKTarget target) throws Exception {
+ IPath scriptPath = createStockScript(target, "echo hello\n");
+
+ // make an overridden environment that has the script directory in its PATH
+ String scriptDir = scriptPath.removeLastSegments(1).toPortableString();
+ IEnvironmentModifierBlock envVarBlock =
+ ProcessLauncherUtils.addToPATH(target.getSDK().getMachine(),
+ target.getProcessLauncherFactory(),
+ scriptDir, true);
+
+ IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(
+ target.getProcessLauncherFactory(),
+ null,
+ CommandLineArguments.createFromCommandLine(scriptPath.lastSegment()),
+ envVarBlock);
+
+ processLauncher.createProcess();
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ByteArrayOutputStream err = new ByteArrayOutputStream();
+ int exit = processLauncher.waitAndRead(out, err);
+ assertEquals(target+":\n"+err.toString(), 0, exit);
+
+ assertStdTextEquals("hello\n", out.toString());
+ }
+ });
+ }
+}
\ No newline at end of file
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestRunStandalone.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestRunStandalone.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestRunStandalone.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.scratchbox.tests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Test;
+import org.maemo.esbox.scratchbox.core.sdk.ScratchboxSDKFacade;
+import org.maemo.mica.common.core.process.ProcessLauncherParameters;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.common.launch.adapters.IRunStandaloneAdapter;
+
+
+/**
+ * Test that the "run standalone" support is wired up properly.
+ * @author eswartz
+ *
+ */
+public class TestRunStandalone {
+ @Test
+ public void testSbox() throws Exception {
+ for (ISDKTarget sdkTarget : ScratchboxSDKFacade.getInstance().getScratchboxSDKTargets()) {
+ IRunStandaloneAdapter support = (IRunStandaloneAdapter) sdkTarget.getAdapter(IRunStandaloneAdapter.class);
+ if (sdkTarget.getPlatform().getName().toLowerCase().matches("chinook|diablo|fremantle")) {
+ assertNotNull(sdkTarget.getName(), support);
+ } else {
+ continue;
+ }
+ assertEquals(true, support.getDefault());
+ assertNotNull(support.getLabelText());
+ assertNotNull(support.getTooltipText());
+
+ ProcessLauncherParameters params = new ProcessLauncherParameters();
+ params.getCommandLine().add("ls");
+
+ support.updateLaunch(params, false);
+ assertEquals(1, params.getCommandLine().size());
+ assertEquals("ls", params.getCommandLine().get(0));
+
+ support.updateLaunch(params, true);
+ assertEquals(2, params.getCommandLine().size());
+ assertEquals("run-standalone.sh", params.getCommandLine().get(0));
+ assertEquals("ls", params.getCommandLine().get(1));
+ }
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestSB1ProcessLauncher.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestSB1ProcessLauncher.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestSB1ProcessLauncher.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,171 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests;
+
+import org.eclipse.core.runtime.*;
+import org.junit.Test;
+import org.maemo.esbox.internal.scratchbox.sb1.provider.Scratchbox1SDKProvider;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.env.EnvironmentManager;
+import org.maemo.mica.common.core.env.IEnvironmentModifierBlock;
+import org.maemo.mica.common.core.process.*;
+import org.maemo.mica.common.core.sdk.*;
+
+import java.io.ByteArrayOutputStream;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * If SB1 is installed, make sure its SDKs and targets are properly detected,
+ * and that it launches processes in the expected way
+ *
+ * @author eswartz
+ *
+ */
+public class TestSB1ProcessLauncher extends TestProcessLauncher {
+ ISDKProvider sb1Provider;
+ private static List<ISDK> sdks;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ SDKFactory factory = SDKFactory.getInstance();
+
+ List<ISDKProvider> providers = factory.getSDKProviders();
+ assertNotNull(providers);
+
+ // don't worry if we don't find an SB1 installation
+ // on this host (this is mostly a manual test)
+ for (ISDKProvider provider : providers) {
+ if (provider instanceof Scratchbox1SDKProvider) {
+ sb1Provider = provider;
+ break;
+ }
+ }
+
+ if (sb1Provider == null && !Platform.isRunning()) {
+ // in case of standalone test
+ sb1Provider = new Scratchbox1SDKProvider();
+ }
+
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected List<ISDK> getSDKs() throws ESboxException {
+ if (sdks == null) {
+ if (sb1Provider == null)
+ sdks = Collections.EMPTY_LIST;
+ else
+ sdks = sb1Provider.createSDKs();
+ }
+ return sdks;
+ }
+
+ /** Make sure commands are assembled appropriately */
+ @Test
+ public void testSB1ProcessLauncherAssembly() throws Exception {
+ runOverTargets(new IRunner() {
+
+ public void run(ISDKTarget target) throws Exception {
+ IProcessLauncherFactory processLauncherFactory = target
+ .getProcessLauncherFactory();
+ IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(
+ processLauncherFactory, "ls");
+ List<String> args = processLauncher.getLaunchCommandArguments();
+ assertNotNull(args);
+
+ // be sure no variables are left unexpanded
+ assertFalse(CommandLineArguments.toCommandLine(args).contains("${"));
+
+ // assume the pattern is still /scratchbox/login ...
+ assertEquals("/scratchbox/login", args.get(0));
+ }
+ });
+ }
+
+ /** Make sure arguments appear to be passed appropriately */
+ @Test
+ public void testSB1ProcessLauncherArguments() throws Exception {
+ runOverTargets(new IRunner() {
+
+ public void run(ISDKTarget target) throws Exception {
+ IProcessLauncherFactory processLauncherFactory = target
+ .getProcessLauncherFactory();
+ IEnvironmentModifierBlock envVars = EnvironmentManager.getInstance().createEnvironmentModifierBlock();
+ envVars.define("CC", "gcc");
+ envVars.define("LDFLAGS", "-lm");
+ envVars.define("SPACEY", "a b c");
+ envVars.define("WILD", "*");
+ envVars.undefine("FOOBAR");
+ IPath tempPath = new Path("/tmp");
+ IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(processLauncherFactory,
+ tempPath,
+ "./configure", CommandLineArguments.createFromVarArgs(
+ "--enable-maintainer-mode",
+ "--disable-gtk"), envVars);
+
+ // the env vars are encoded into run.sh, not passed outside the
+ // process
+ IEnvironmentModifierBlock launchEnvironment = processLauncher
+ .getLaunchEnvironmentModifierBlock();
+ assertNull(launchEnvironment);
+
+ List<String> args = processLauncher.getLaunchCommandArguments();
+ assertNotNull(args);
+
+ // be sure no variables are left unexpanded
+ assertFalse(CommandLineArguments.toCommandLine(args).contains("${"));
+
+ // assume the pattern is still /scratchbox/login -d ...
+ // ".../run.sh ... \".... <command>\""
+ // (basically verifying the command is wrapped)
+ assertEquals("/scratchbox/login", args.get(0));
+ String last = args.get(args.size() - 1);
+ // System.out.println(last);
+ assertEquals(
+ "./run.sh " + tempPath.toPortableString() + " \\\"CC=gcc,LDFLAGS=-lm,SPACEY=a b c,WILD=*,-FOOBAR\\\" \\\"./configure --enable-maintainer-mode --disable-gtk\\\"",
+ last);
+
+ }
+ });
+ }
+
+
+ /** Test that the Esbox environment variables are passed properly. */
+ @Test
+ public void testEnvironmentPassingSb1() throws Exception {
+ runOverTargets(new IRunner() {
+
+ public void run(ISDKTarget target) throws Exception {
+ IEnvironmentModifierBlock envVars = EnvironmentManager.getInstance().createEnvironmentModifierBlock();
+
+ envVars.define("DISPLAY", ":2");
+ envVars.define("ESBOXOVERRIDE", "launch_override");
+ envVars.define("PASSEDIN", "launch_passedin");
+
+ String cmdText = "echo $DISPLAY,$ESBOXONLY,$ESBOXOVERRIDE,$PASSEDIN";
+ IProcessLauncher processLauncher = createAndLaunchStockProcessForScript(
+ target, null, cmdText, envVars);
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ByteArrayOutputStream err = new ByteArrayOutputStream();
+ int exit = processLauncher.waitAndRead(out, err);
+ assertEquals(0, exit);
+
+ assertEquals("", err.toString());
+ assertEquals(":2,,launch_override,launch_passedin", out.toString().trim());
+
+ }
+ });
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestSB1SDKProvider.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestSB1SDKProvider.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestSB1SDKProvider.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests;
+
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.runtime.*;
+import org.junit.Test;
+import org.maemo.esbox.internal.scratchbox.sb1.provider.Scratchbox1SDKProvider;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.machine.ILocalMachine;
+import org.maemo.mica.common.core.sdk.*;
+import org.maemo.mica.common.core.tests.core.BaseTest;
+
+import java.util.List;
+
+/**
+ * If SB1 is installed, make sure its SDKs and targets
+ * are properly detected, and that it launches processes
+ * in the expected way
+ * @author eswartz
+ *
+ */
+public class TestSB1SDKProvider extends BaseTest {
+ private ISDKProvider sb1Provider;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ SDKFactory factory = SDKFactory.getInstance();
+
+ List<ISDKProvider> providers = factory.getSDKProviders();
+ assertNotNull(providers);
+
+ // don't worry if we don't find an SB1 installation
+ // on this host (this is mostly a manual test)
+ for (ISDKProvider provider : providers) {
+ if (provider instanceof Scratchbox1SDKProvider) {
+ sb1Provider = provider;
+ break;
+ }
+ }
+
+ if (sb1Provider == null && !Platform.isRunning()) {
+ // in case of standalone test
+ sb1Provider = new Scratchbox1SDKProvider();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+
+ }
+
+ @Test
+ public void testSB1SDKProvider() throws Exception {
+ if (sb1Provider == null)
+ return;
+
+ List<ISDK> sdks = sb1Provider.createSDKs();
+ assertNotNull(sdks);
+
+ for (ISDK sdk : sdks) {
+ // the name mentions the scratchbox name and version
+ assertEquals("Scratchbox 1", sdk.getName());
+ assertTrue(sdk.getVersion().matches("1\\.0\\.\\d+"));
+ IPath root = sdk.getSDKRoot();
+ assertTrue(sdk.getMachineFileSystemAccess().getFileStore(root).fetchInfo().exists());
+ assertTrue(root.toPortableString().startsWith("/scratchbox/"));
+ }
+ }
+
+ @Test
+ public void testSB1SDKTargets() throws Exception {
+ if (sb1Provider == null)
+ return;
+
+ List<ISDK> sdks = sb1Provider.createSDKs();
+ for (ISDK sdk : sdks) {
+ ISDKTarget[] targets = sdk.getSDKTargets();
+ // for this test, we need to have something to test
+ assertTrue(targets.length > 0);
+ for (ISDKTarget target : targets) {
+ _testSDKTarget(target);
+ _testSDKTargetFileConvs(target);
+ _testSDKTargetFileAccess(target);
+ }
+ }
+ }
+
+ private void _testSDKTarget(ISDKTarget target) {
+ System.out.println("found target: " + target);
+
+ assertNotNull(target.getSDK());
+ assertSame(target, target.getSDK().findSDKTarget(target.getName()));
+ assertNotNull(target.getName());
+ assertNotNull(target.getProcessLauncherFactory());
+ assertNotNull(target.getPlatform());
+ assertNotNull(target.getArchitecture());
+
+ }
+
+ private void _testSDKTargetFileConvs(ISDKTarget target) {
+ // make sure root makes sense
+ assertEquals(target.getSDK().getSDKRoot(), target.getSDKRoot());
+ assertTrue(target.getSDK().getSDKRoot().isPrefixOf(target.getSDKRoot()));
+ assertTrue(target.getSDKRoot().toString(), target.getMachineFileSystemAccess().getFileStore(
+ target.getSDKRoot()).fetchInfo().exists());
+
+
+ // test some conversions
+ IPath sbPath, hostPath;
+
+ // all of these paths may appear at different places inside scratchbox
+ String[] tests = {
+ "/tmp",
+ "/usr",
+ "/usr/include",
+ "/usr/lib",
+ "/bin",
+ "/bin/sh",
+ "/sbin",
+ "/usr/include/fcntl.h"
+ };
+ for (String test : tests) {
+ sbPath = new Path(test);
+ hostPath = null;
+
+ // ignore bogus target installed on my system -- no underscore in name
+ if (target.getName().contains("_")) {
+ // make sure the path can be converted to somewhere on the machine
+ // (no guarantee we can see it on the host machine)
+ IFileStore store = target.getTargetFileSystemAccess().getFileStore(sbPath);
+ assertTrue(target + " @" + sbPath.toString(), store.fetchInfo().exists());
+
+ // if we happen to be running locally, verify sanity
+ if (target.getSDK().getMachine() instanceof ILocalMachine) {
+ try {
+ hostPath = target.convertTargetToHostPath(sbPath);
+ assertTrue(hostPath.toFile().toString(),
+ target.getTargetFileSystemAccess().getFileStore(hostPath).fetchInfo().exists());
+ // there's no guarantee of being able to convert back, but
+ // at least don't throw
+ //assertEquals(sbPath, target.convertHostToTargetPath(hostPath));
+ target.convertHostToTargetPath(hostPath);
+ } catch (ESboxException e) {
+ fail(e.getMessage());
+ }
+ }
+ }
+ }
+
+ }
+
+ private void _testSDKTargetFileAccess(ISDKTarget target) {
+ IFileStore sbRoot = target.getTargetFileSystemAccess().getFileStore(target.getSDKRoot());
+ assertTrue(sbRoot.fetchInfo().exists());
+
+ // these tests only make sense if running the scratchbox machine
+
+ // be sure we don't get an empty path here
+ IPath sbPath = null;
+ IPath hostPath;
+ try {
+ sbPath = target.convertHostToTargetPath(target.getSDKRoot());
+ assertEquals(new Path("/"), sbPath);
+
+ // guaranteed NOT to be an SB1 path
+ hostPath = new Path("/");
+ try {
+ sbPath = target.convertHostToTargetPath(hostPath);
+ fail();
+ } catch (ESboxException e) {
+ }
+
+ IPath rootstrapPath = ((IScratchboxSDKTarget) target).getRootstrapPath();
+ if (target.getName().toLowerCase().contains("chinook40"))
+ assertNotNull(rootstrapPath);
+ if (rootstrapPath != null) {
+ System.out.println(" rootstrap path is -> " + rootstrapPath);
+ IFileStore store = target.getTargetFileSystemAccess().getFileStore(rootstrapPath);
+ assertTrue(store.fetchInfo().exists());
+ assertTrue(store.getChild("/lib").fetchInfo().exists());
+ }
+ } catch (ESboxException e) {
+ // just handle it
+ }
+
+ }
+
+
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestSB2ProcessLauncher.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestSB2ProcessLauncher.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestSB2ProcessLauncher.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.junit.Test;
+import org.maemo.esbox.internal.scratchbox.sb2.provider.Scratchbox2SDKProvider;
+import org.maemo.mica.common.core.*;
+import org.maemo.mica.common.core.process.*;
+import org.maemo.mica.common.core.sdk.*;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * If SB2 is installed, make sure its SDKs and targets are properly detected,
+ * and that it launches processes in the expected way
+ *
+ * @author eswartz
+ *
+ */
+public class TestSB2ProcessLauncher extends TestProcessLauncher {
+ ISDKProvider sb2Provider;
+ private static List<ISDK> sdks;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ IPreferenceStore preferenceStore = CorePreferenceManager.getInstance().getPreferenceStore(
+ CorePreferenceConstants.LOG_COMMANDS);
+ preferenceStore.setValue(
+ CorePreferenceConstants.LOG_COMMANDS, true);
+
+ SDKFactory factory = SDKFactory.getInstance();
+
+ List<ISDKProvider> providers = factory.getSDKProviders();
+ assertNotNull(providers);
+
+ // don't worry if we don't find an SB2 installation
+ // on this host (this is mostly a manual test)
+ for (ISDKProvider provider : providers) {
+ if (provider instanceof Scratchbox2SDKProvider) {
+ sb2Provider = provider;
+ break;
+ }
+ }
+
+ if (sb2Provider == null && !Platform.isRunning()) {
+ // in case of standalone test
+ sb2Provider = new Scratchbox2SDKProvider();
+ }
+
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected List<ISDK> getSDKs() throws ESboxException {
+ if (sdks == null) {
+ if (sb2Provider == null)
+ sdks = Collections.EMPTY_LIST;
+ else
+ sdks = sb2Provider.createSDKs();
+ }
+ return sdks;
+ }
+
+ /** Make sure commands are assembled appropriately */
+ @Test
+ public void testSB2ProcessLauncherAssembly() throws Exception {
+ runOverTargets(new IRunner() {
+
+ public void run(ISDKTarget target) throws Exception {
+ IProcessLauncherFactory processLauncherFactory = target
+ .getProcessLauncherFactory();
+ IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(processLauncherFactory, "ls");
+ List<String> args = processLauncher.getLaunchCommandArguments();
+ assertNotNull(args);
+
+ // be sure no variables are left unexpanded
+ assertFalse(CommandLineArguments.toCommandLine(args).contains("${"));
+
+ // assume the pattern is still sb2 -e -t ...
+ assertEquals("sb2", args.get(0));
+ assertTrue(args.contains("-t"));
+ assertTrue(args.contains("-e") || args.contains("-m"));
+ }
+ });
+ }
+
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestSB2SDKProvider.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestSB2SDKProvider.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/TestSB2SDKProvider.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,158 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests;
+
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.runtime.*;
+import org.junit.Test;
+import org.maemo.esbox.internal.scratchbox.sb2.provider.Scratchbox2SDKProvider;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.machine.ILocalMachine;
+import org.maemo.mica.common.core.sdk.*;
+
+import java.util.List;
+
+import junit.framework.TestCase;
+
+/**
+ * If SB2 is installed, make sure its SDKs and targets
+ * are properly detected, and that it launches processes
+ * in the expected way
+ * @author eswartz
+ *
+ */
+public class TestSB2SDKProvider extends TestCase {
+ private ISDKProvider sb2Provider;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ SDKFactory factory = SDKFactory.getInstance();
+
+ List<ISDKProvider> providers = factory.getSDKProviders();
+ assertNotNull(providers);
+
+ // don't worry if we don't find an SB1 installation
+ // on this host (this is mostly a manual test)
+ for (ISDKProvider provider : providers) {
+ if (provider instanceof Scratchbox2SDKProvider) {
+ sb2Provider = provider;
+ break;
+ }
+ }
+
+ if (sb2Provider == null && !Platform.isRunning()) {
+ // in case of standalone test
+ sb2Provider = new Scratchbox2SDKProvider();
+ }
+
+ }
+
+ @Test
+ public void testSB2SDKProvider() throws Exception {
+ if (sb2Provider == null)
+ return;
+
+ List<ISDK> sdks = sb2Provider.createSDKs();
+ assertNotNull(sdks);
+
+ for (ISDK sdk : sdks) {
+ // the name mentions the scratchbox name and version
+ assertEquals("Scratchbox 2", sdk.getName());
+ assertTrue(sdk.getVersion().matches("1\\.99\\..*"));
+ IPath root = sdk.getSDKRoot();
+ assertTrue(sdk.getMachineFileSystemAccess().getFileStore(root).fetchInfo().exists());
+ assertTrue(root.toPortableString().equals("/"));
+ }
+ }
+
+ @Test
+ public void testSB2SDKTargets() throws Exception {
+ if (sb2Provider == null)
+ return;
+
+ List<ISDK> sdks = sb2Provider.createSDKs();
+ for (ISDK sdk : sdks) {
+ ISDKTarget[] targets = sdk.getSDKTargets();
+ for (ISDKTarget target : targets) {
+ if (target.getName().contains("DELETEME") || target.getName().contains("bora"))
+ continue;
+ _testSDKTarget(target);
+ }
+ }
+ }
+
+ private void _testSDKTarget(ISDKTarget target) {
+ System.out.println("found sb2 target: " + target);
+
+ assertNotNull(target.getSDK());
+ assertSame(target, target.getSDK().findSDKTarget(target.getName()));
+ assertNotNull(target.getName());
+ assertNotNull(target.getProcessLauncherFactory());
+ assertNotNull(target.getPlatform());
+ assertNotNull(target.getArchitecture());
+
+ // make sure root makes sense
+ assertEquals("target sdk->root", target.getSDK().getSDKRoot(), target.getSDKRoot());
+ assertTrue(target + " root ", target.getSDK().getSDKRoot().isPrefixOf(target.getSDKRoot()));
+ assertTrue(target + " filesystem root", target.getTargetFileSystemAccess().getFileStore(target.getSDKRoot()).fetchInfo().exists());
+
+
+ // test some conversions
+ IPath sbPath = new Path("/usr/include");
+ IFileStore hostFile = null;
+ hostFile = target.getTargetFileSystemAccess().getFileStore(sbPath);
+ assertTrue(target + ": "+ hostFile.toString(), hostFile.fetchInfo().exists());
+
+ // be sure we don't get an empty path here
+ IFileStore sbRoot = null;
+ sbRoot = target.getSDK().getMachineFileSystemAccess().getFileStore(target.getSDKRoot());
+ assertTrue(sbRoot.fetchInfo().exists());
+
+ // these tests only work on machine
+ IPath hostPath = new Path("/");
+ if (target.getSDK().getMachine() instanceof ILocalMachine) {
+ try {
+ sbPath = target.convertHostToTargetPath(hostPath);
+ } catch (ESboxException e) {
+ fail(e.toString());
+ }
+ assertEquals(hostPath, sbPath);
+ }
+
+ // make sure we can find the non-host version
+ IPath libPath = new Path("/lib");
+ hostPath = target.getMachineToSDKTargetFileSystemMapping().convertTargetToHostPath(libPath);
+ if (hostPath.equals(libPath))
+ failNotEquals("expected unique sb2 path from " + target, hostPath, libPath);
+
+ // verify new parser
+ IPath etcPath = new Path("/etc");
+ hostPath = target.getMachineToSDKTargetFileSystemMapping().convertTargetToHostPath(etcPath);
+ assertNotNull(hostPath);
+ assertTrue(hostPath.toString(),
+ new Path("/opt/maemo/dists/etch/etc").equals(hostPath)
+ || etcPath.equals(hostPath));
+
+ IPath rootstrapPath = ((IScratchboxSDKTarget) target).getRootstrapPath();
+ if (target.getName().contains("chinook40"))
+ assertNotNull(rootstrapPath);
+ if (rootstrapPath != null) {
+ System.out.println(target + " root is -> " + rootstrapPath);
+ IFileStore store = target.getTargetFileSystemAccess().getFileStore(rootstrapPath);
+ assertTrue(store.fetchInfo().exists());
+ assertTrue(store.getChild("lib").fetchInfo().exists());
+ }
+
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/AllTests.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/AllTests.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/AllTests.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @author eswartz
+ *
+ */
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(
+ "Test for org.maemo.esbox.scratchbox.tests.commands");
+ //$JUnit-BEGIN$
+ suite.addTestSuite(TestRootstrapCommand.class);
+ suite.addTestSuite(TestGdbQemuCommand.class);
+ suite.addTestSuite(TestSelectTargetCommand.class);
+ suite.addTestSuite(TestShowTargetCommand.class);
+ suite.addTestSuite(TestRemoveCommand.class);
+ suite.addTestSuite(TestCreateTargetSb2Command.class);
+ suite.addTestSuite(TestShowPathMappingSb2Command.class);
+ suite.addTestSuite(TestResetTargetCommand.class);
+ suite.addTestSuite(TestScratchboxCommand.class);
+ suite.addTestSuite(TestListCommands.class);
+ suite.addTestSuite(TestRemoveSb2Command.class);
+ suite.addTestSuite(TestSimpleCommand.class);
+ suite.addTestSuite(TestCreateTargetCommand.class);
+ suite.addTestSuite(TestGetCurrentTargetCommand.class);
+ suite.addTestSuite(TestScratchboxFacade.class);
+ suite.addTestSuite(TestListSb2Commands.class);
+ //$JUnit-END$
+ return suite;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/BaseTest.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/BaseTest.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/BaseTest.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import org.junit.Before;
+import org.maemo.esbox.internal.scratchbox.sb1.core.Scratchbox1SDK;
+import org.maemo.esbox.internal.scratchbox.sb2.core.Scratchbox2SDK;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+import org.maemo.esbox.scratchbox.core.sdk.ScratchboxSDKFacade;
+import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDK;
+import org.maemo.esbox.scratchbox.sb2.sdk.IScratchbox2SDK;
+import org.maemo.mica.common.core.machine.IFileSystemAccess;
+import org.maemo.mica.common.core.process.IProcessLauncherFactory;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import junit.framework.TestCase;
+
+/**
+ * Base test for the ICommand tests
+ * @author eswartz
+ *
+ */
+public abstract class BaseTest extends TestCase {
+
+ protected IScratchbox1SDK sb1Sdk;
+ protected ICommandAbstractor sb1Command;
+ protected IScratchbox2SDK sb2Sdk;
+ protected ICommandAbstractor sb2Command;
+ protected ICommandAbstractor sb2ArmelTargetCommand;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ this.sb1Sdk = ScratchboxSDKFacade.getInstance().getScratchboxSDK(IScratchbox1SDK.class).get(0);
+ this.sb1Command = ((Scratchbox1SDK) sb1Sdk).getCommandAbstractor();
+ this.sb2Sdk = ScratchboxSDKFacade.getInstance().getScratchboxSDK(IScratchbox2SDK.class).get(0);
+ this.sb2Command = ((Scratchbox2SDK) sb2Sdk).getCommandAbstractor();
+ if (sb2Sdk != null) {
+ for (ISDKTarget target : sb2Sdk.getSDKTargets()) {
+ if (target.getArchitecture().equals(IScratchboxSDKTarget.ARCHITECTURE_ARMEL) &&
+ !target.getName().contains("minimal") &&
+ !target.getName().contains("REMOVEME")) {
+ final ISDKTarget sdkTarget = target;
+ this.sb2ArmelTargetCommand = new ICommandAbstractor() {
+
+ public String getPreferenceValue(String key) {
+ return sdkTarget.getPreferenceValue(key);
+ }
+
+ public IProcessLauncherFactory getProcessLauncherFactory() {
+ return sdkTarget.getProcessLauncherFactory();
+ }
+
+ public IFileSystemAccess getFileSystemAccess() {
+ return sdkTarget.getTargetFileSystemAccess();
+ }
+ };
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Get a command abstractor that will not actually execute code.
+ * @param target if non-null, use an SB2 mock process launcher, else use a host mock process launcher
+ * @return ICommandAbstractor
+ */
+ protected MockCommandAbstractor getSb2MockCommandAbstractor(final ISDKTarget target) {
+ return new MockCommandAbstractor(sb2Command, target);
+
+ }
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/MockCommandAbstractor.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/MockCommandAbstractor.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/MockCommandAbstractor.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import org.maemo.mica.common.core.machine.IFileSystemAccess;
+import org.maemo.mica.common.core.process.HostProcessLauncherFactory;
+import org.maemo.mica.common.core.process.IProcessLauncherFactory;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.List;
+
+public class MockCommandAbstractor implements ICommandAbstractor {
+ private final ISDKTarget target;
+ private final ICommandAbstractor wrapped;
+ private MockProcessLauncherFactory lastLauncherFactory;
+
+ public MockCommandAbstractor(ICommandAbstractor wrapped, ISDKTarget target) {
+ this.wrapped = wrapped;
+ this.target = target;
+ }
+
+ public String getPreferenceValue(String key) {
+ return wrapped.getPreferenceValue(key);
+ }
+
+ public IProcessLauncherFactory getProcessLauncherFactory() {
+ if (target != null)
+ lastLauncherFactory = new MockProcessLauncherFactory(
+ target.getProcessLauncherFactory());
+ //new Scratchbox2ProcessLauncherFactory(
+ //target, SB2PreferenceConstants.SB2_MAPPING_MODE, false));
+ else
+ lastLauncherFactory = new MockProcessLauncherFactory(new HostProcessLauncherFactory());
+ return lastLauncherFactory;
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.internal.common.core.command.ICommandAbstractor#getFileSystemAccess()
+ */
+ public IFileSystemAccess getFileSystemAccess() {
+ return target.getTargetFileSystemAccess();
+ }
+
+ public List<String> getLastCommandLine() {
+ return lastLauncherFactory.getLastCommandLine();
+ }
+}
\ No newline at end of file
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/MockProcessLauncher.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/MockProcessLauncher.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/MockProcessLauncher.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,192 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ui.console.MessageConsole;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.env.IEnvironmentModifierBlock;
+import org.maemo.mica.common.core.process.IProcessLauncher;
+import org.maemo.mica.common.core.process.IStreamLineMonitor;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.List;
+
+/**
+ * This process launcher does not actually launch anything but allows
+ * access to the generated arguments and environment.
+ * @author eswartz
+ *
+ */
+public class MockProcessLauncher implements IProcessLauncher {
+
+ private final IProcessLauncher wrapped;
+ private Process theProcess;
+
+ public MockProcessLauncher(IProcessLauncher launcher) {
+ this.wrapped = launcher;
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.common.core.IProcessLauncher#createProcess()
+ */
+ public Process createProcess() throws ESboxException {
+ theProcess = new Process() {
+
+ @Override
+ public void destroy() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public int exitValue() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public InputStream getErrorStream() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public InputStream getInputStream() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public OutputStream getOutputStream() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int waitFor() throws InterruptedException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ };
+ return theProcess;
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.common.core.process.IProcessLauncher#getLastCreatedProcess()
+ */
+ public Process getLastCreatedProcess() {
+ return theProcess;
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.common.core.IProcessLauncher#getLaunchCommandArguments()
+ */
+ public List<String> getLaunchCommandArguments() {
+ return wrapped.getLaunchCommandArguments();
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.common.core.IProcessLauncher#getLaunchEnvironment()
+ */
+ public IEnvironmentModifierBlock getLaunchEnvironmentModifierBlock() {
+ return wrapped.getLaunchEnvironmentModifierBlock();
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.common.core.IProcessLauncher#getLaunchCurrentWorkingDirectory()
+ */
+ public IPath getLaunchCurrentWorkingDirectory() {
+ return wrapped.getLaunchCurrentWorkingDirectory();
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.common.core.IProcessLauncher#isUsePTY()
+ */
+ public boolean isUsePTY() {
+ return wrapped.isUsePTY();
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.common.core.IProcessLauncher#usePTY(boolean)
+ */
+ public void usePTY(boolean flag) {
+ wrapped.usePTY(flag);
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.common.core.IProcessLauncher#redirectToConsole(org.eclipse.ui.console.MessageConsole, org.maemo.esbox.common.core.sdk.ISDKTarget)
+ */
+ public MessageConsole redirectToConsole(MessageConsole console) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.common.core.IProcessLauncher#redirectToConsole(org.eclipse.ui.console.MessageConsole, org.maemo.esbox.common.core.sdk.ISDKTarget, org.maemo.esbox.common.core.IStreamLineMonitor)
+ */
+ public MessageConsole redirectToConsole(MessageConsole console,
+ IStreamLineMonitor monitor) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.common.core.IProcessLauncher#redirectToConsole(boolean, org.maemo.esbox.common.core.sdk.ISDKTarget, java.lang.String)
+ */
+ public MessageConsole redirectToConsole(boolean brandNew,
+ ISDKTarget sdkTarget, String consoleName) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.common.core.IProcessLauncher#redirectToConsole(boolean, org.maemo.esbox.common.core.sdk.ISDKTarget, java.lang.String, org.maemo.esbox.common.core.IStreamLineMonitor)
+ */
+ public MessageConsole redirectToConsole(boolean brandNew,
+ ISDKTarget sdkTarget, String consoleName, IStreamLineMonitor monitor) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.common.core.IProcessLauncher#waitAndRead(java.io.OutputStream, java.io.OutputStream)
+ */
+ public int waitAndRead(OutputStream out, OutputStream err) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.common.core.IProcessLauncher#waitAndRead(java.io.OutputStream, java.io.OutputStream, boolean)
+ */
+ public int waitAndRead(OutputStream out, OutputStream err,
+ boolean showCommand) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.common.core.IProcessLauncher#waitAndRead(java.io.OutputStream, java.io.OutputStream, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public int waitAndRead(OutputStream output, OutputStream err,
+ IProgressMonitor monitor) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.common.core.IProcessLauncher#waitAndRead(java.io.OutputStream, java.io.OutputStream, org.eclipse.core.runtime.IProgressMonitor, boolean)
+ */
+ public int waitAndRead(OutputStream output, OutputStream err,
+ IProgressMonitor monitor, boolean showCommand) {
+ return 0;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/MockProcessLauncherFactory.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/MockProcessLauncherFactory.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/MockProcessLauncherFactory.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.runtime.IPath;
+import org.maemo.mica.common.core.env.IEnvironmentModifierBlock;
+import org.maemo.mica.common.core.process.IProcessLauncher;
+import org.maemo.mica.common.core.process.IProcessLauncherFactory;
+
+/**
+ * This factory creates process launchers that do not actually execute anything
+ * but allow for testing the generated command line through the process launcher.
+ * @author eswartz
+ *
+ */
+public class MockProcessLauncherFactory implements IProcessLauncherFactory {
+
+ private IProcessLauncherFactory wrapped;
+ private IProcessLauncher lastProcessLauncher;
+
+ public MockProcessLauncherFactory(IProcessLauncherFactory wrapped) {
+ this.wrapped = wrapped;
+ }
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.common.core.IProcessLauncherFactory#createProcessLauncher(org.eclipse.core.runtime.IPath, java.util.List, java.util.Properties, org.eclipse.cdt.utils.pty.PTY)
+ */
+ public IProcessLauncher createProcessLauncher(IPath workingDirectory,
+ List<String> commandLine, IEnvironmentModifierBlock environment) {
+ lastProcessLauncher = wrapped.createProcessLauncher(workingDirectory, commandLine, environment);
+ return new MockProcessLauncher(lastProcessLauncher);
+ }
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.common.core.process.IProcessLauncherFactory#getDefaultEnvironmentModifierBlock()
+ */
+ public IEnvironmentModifierBlock defaultEnvironmentModifierBlock() {
+ return wrapped.defaultEnvironmentModifierBlock();
+ }
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.common.core.process.IProcessLauncherFactory#getRawEnvironment()
+ */
+ public Properties getRawEnvironment() {
+ return wrapped.getRawEnvironment();
+ }
+
+ public List<String> getLastCommandLine() {
+ return lastProcessLauncher.getLaunchCommandArguments();
+ }
+
+
+
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestCreateTargetCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestCreateTargetCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestCreateTargetCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import org.maemo.esbox.internal.scratchbox.sb1.command.*;
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxCommand;
+import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDK;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Please, read file TESTS.txt for more instructions about test.
+ */
+public class TestCreateTargetCommand extends BaseTest {
+
+
+ private class CreateTargetCommandMock extends CreateTargetCommand {
+
+ public CreateTargetCommandMock(IScratchbox1SDK sdk, ICommandAbstractor commandLauncher) {
+ super(sdk, commandLauncher);
+ }
+
+ @Override
+ protected String[] replaceActions(String targetName, String compiler,
+ String devkits, String cputransp) {
+ // TODO Auto-generated method stub
+ return super.replaceActions(targetName, compiler, devkits,
+ cputransp);
+ }
+
+ }
+
+ private final String TARGET_NAME = "TEST_TARGET";
+
+ public void testPerformCommand() throws ESboxException {
+ ScratchboxCommand createTargetCommand = new CreateTargetCommand(sb1Sdk, sb1Command);
+
+ List<String> param = new ArrayList<String>();
+
+ param.add(TARGET_NAME);
+ param.add("cs2005q3.2-glibc2.5-arm");
+ param.add("doctools:cputransp");
+ try {
+ createTargetCommand.performCommand(param);
+ fail("Number of args is invalid");
+ } catch (ESboxException e) {
+ // expected
+ }
+ param.add("qemu-arm-0.8.2-sb2");
+ createTargetCommand.performCommand(param);
+
+ List<String> targetsAvailable = new ListTargetsCommand(sb1Command)
+ .performCommand(new ArrayList<String>());
+ assertTrue(targetsAvailable.contains(TARGET_NAME));
+
+ // remove the target created for the test
+ removeTestTarget();
+ targetsAvailable = new ListTargetsCommand(sb1Command)
+ .performCommand(new ArrayList<String>());
+ assertTrue(!targetsAvailable.contains(TARGET_NAME));
+
+ param.clear();
+ param.add(TARGET_NAME);
+ param.add("");
+ param.add("debian:doctools:cputransp");
+ param.add("qemu-arm-0.8.2-sb2");
+ try {
+ createTargetCommand.performCommand(param);
+ fail("Cannot create a TARGET without a compiler.");
+ } catch (ESboxException se) {
+ // expected
+ }
+ targetsAvailable = new ListTargetsCommand(sb1Command)
+ .performCommand(new ArrayList<String>());
+ assertTrue(!targetsAvailable.contains(TARGET_NAME));
+ }
+
+ private void removeTestTarget() throws ESboxException {
+ ScratchboxCommand removeCommand = new RemoveTargetCommand(sb1Sdk, sb1Command);
+ List<String> removeParam = new ArrayList<String>();
+ removeParam.add(TARGET_NAME);
+ removeCommand.performCommand(removeParam);
+ }
+
+ public void testReplaceActions() {
+ final String stringToCompareA = "sb-conf setup "
+ + TARGET_NAME
+ + " --compiler=a_compiler --devkits=devkit_a:devkit_b --cputransp=a_cputransp_method";
+ final String[] stringArrayToCompareA = new String[] { TARGET_NAME,
+ "--compiler=a_compiler", "--devkits=devkit_a:devkit_b",
+ "--cputransp=a_cputransp_method" };
+
+ CreateTargetCommandMock createCommand = new CreateTargetCommandMock(sb1Sdk, sb1Command);
+ String[] setupActionOptionsReplaced = createCommand.replaceActions(
+ TARGET_NAME, "a_compiler", "devkit_a:devkit_b",
+ "a_cputransp_method");
+
+ for (int i = 0; i < setupActionOptionsReplaced.length; i++) {
+ assertEquals(stringArrayToCompareA[i],
+ setupActionOptionsReplaced[i]);
+ }
+
+ String setupAction = sb1Sdk.getPreferenceValue(SB1PreferenceConstants.SB1_SETUP_ACT);
+
+ String stringSetup = createCommand.replaceScratchboxConfigCommand(
+ setupAction, setupActionOptionsReplaced);
+ assertEquals(stringToCompareA, stringSetup);
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestCreateTargetSb2Command.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestCreateTargetSb2Command.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestCreateTargetSb2Command.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,69 @@
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import org.maemo.esbox.internal.scratchbox.sb2.command.CreateTargetSb2Command;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxCommand;
+import org.maemo.mica.common.core.ESboxException;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class TestCreateTargetSb2Command extends BaseTest {
+
+ private final String TARGET_NAME = "TEST_TARGET";
+ private final String COMPILER = "/opt/maemo/tools/arm-2007q3/bin/arm-none-linux-gnueabi-gcc";
+ private final String CPUTRANSP = "sb2-qemu-arm";
+
+ public void testPerformCommand() throws ESboxException {
+ MockCommandAbstractor mockCommandAbstractor = getSb2MockCommandAbstractor(null);
+ ScratchboxCommand createTargetCommand = new CreateTargetSb2Command(sb2Sdk,
+ mockCommandAbstractor);
+
+ List<String> param = new ArrayList<String>();
+
+ param.add(TARGET_NAME);
+ param.add(COMPILER);
+ try {
+ createTargetCommand.performCommand(param);
+ fail("Number of args is invalid");
+ } catch (ESboxException e) {
+ // expected
+ }
+ param.add(CPUTRANSP);
+ createTargetCommand.performCommand(param);
+
+ List<String> lastCmdLine = mockCommandAbstractor.getLastCommandLine();
+ assertEquals("/bin/bash", lastCmdLine.get(0));
+ assertEquals("-c", lastCmdLine.get(1));
+
+ String command = lastCmdLine.get(2);
+ assertEquals("sb2-init -c " + CPUTRANSP + " " + TARGET_NAME + " " + COMPILER, command);
+ }
+
+ public void testPerformCommandNoCpuTransp() throws ESboxException {
+ MockCommandAbstractor mockCommandAbstractor = getSb2MockCommandAbstractor(null);
+ ScratchboxCommand createTargetCommand = new CreateTargetSb2Command(sb2Sdk,
+ mockCommandAbstractor);
+
+ List<String> param = new ArrayList<String>();
+
+ param.add(TARGET_NAME);
+ param.add(COMPILER);
+ try {
+ createTargetCommand.performCommand(param);
+ fail("Number of args is invalid");
+ } catch (ESboxException e) {
+ // expected
+ }
+ param.add(null);
+ createTargetCommand.performCommand(param);
+
+ List<String> lastCmdLine = mockCommandAbstractor.getLastCommandLine();
+ assertEquals("/bin/bash", lastCmdLine.get(0));
+ assertEquals("-c", lastCmdLine.get(1));
+
+ String command = lastCmdLine.get(2);
+ assertEquals("sb2-init " + TARGET_NAME + " " + COMPILER, command);
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestGdbQemuCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestGdbQemuCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestGdbQemuCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia)- initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+import org.maemo.esbox.scratchbox.core.sdk.ScratchboxSDKFacade;
+import org.maemo.mica.common.core.ESboxException;
+
+
+/**
+ * @author eswartz
+ */
+public class TestGdbQemuCommand extends BaseTest {
+
+ public void testQemuVersionCommand() throws ESboxException {
+ for (IScratchboxSDKTarget sdkTarget : ScratchboxSDKFacade.getInstance().getScratchboxSDKTargets()) {
+ String pattern = sdkTarget.getGdbQemuCommandPattern(
+ sdkTarget.getArchitecture());
+ assertNotNull(pattern);
+ if (sdkTarget.getSboxVersion() == 2) {
+ assertTrue(pattern.contains("${PORT}"));
+ }
+ if (sdkTarget.getArchitecture().equals(IScratchboxSDKTarget.ARCHITECTURE_ARMEL)) {
+ assertTrue(pattern.contains("qemu-arm"));
+ if (pattern.contains("qemu-arm-0.7"))
+ assertFalse(pattern.contains("${PORT}"));
+ else if (pattern.contains("qemu-arm-0.8"))
+ assertTrue(pattern.contains("${PORT}"));
+ }
+ System.out.println("pattern of gdb-qemu for " + sdkTarget + " is " + pattern);
+ }
+ }
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestGetCurrentTargetCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestGetCurrentTargetCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestGetCurrentTargetCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import org.maemo.esbox.internal.api.scratchbox.core.commands.ScratchboxInvalidOperationException;
+import org.maemo.esbox.internal.scratchbox.sb1.command.GetCurrentTargetCommand;
+import org.maemo.mica.common.core.ESboxException;
+
+import java.util.ArrayList;
+
+/**
+ * Please, read file TESTS.txt for more instructions about test.
+ */
+public class TestGetCurrentTargetCommand extends BaseTest {
+
+ /**
+ * Test method for
+ * {@link embedded.core.scratchbox.command.GetCurrentTargetCommand#performCommand(java.lang.Object)}.
+ *
+ * @throws ScratchboxInvalidOperationException
+ */
+ public void testPerformCommand() throws ESboxException {
+ GetCurrentTargetCommand getCurrentTargetCommand = new GetCurrentTargetCommand(sb1Command, sb1Sdk);
+ String currentTarget = getCurrentTargetCommand
+ .performCommand(new ArrayList<String>());
+ assertTrue(currentTarget.length() > 0);
+ assertNotNull(sb1Sdk.findSDKTarget(currentTarget));
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestListCommands.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestListCommands.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestListCommands.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,313 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import org.maemo.esbox.internal.scratchbox.sb1.command.*;
+import org.maemo.esbox.internal.scratchbox.sb1.core.Scratchbox1SDK;
+import org.maemo.esbox.scratchbox.core.sdk.ScratchboxSDKFacade;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.HostUtils;
+import org.maemo.mica.common.core.process.IProcessLauncher;
+import org.maemo.mica.common.core.process.ProcessLauncherCreator;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+
+import java.util.*;
+
+/**
+ * Please, read file TESTS.txt for more instructions about test.
+ */
+public class TestListCommands extends BaseTest {
+
+ /**
+ * Test method for
+ * {@link embedded.core.scratchbox.command.ListCompilersCommand#performCommand(java.util.List)}.
+ */
+ public void testListCompilersCommand() throws ESboxException {
+ List<String> fakeParam = new ArrayList<String>();
+ fakeParam.add("param");
+
+ List<String> compilersExpected = new ArrayList<String>();
+ compilersExpected.add("host-gcc");
+ compilersExpected.add("cs2005q3.2-glibc2.5-arm");
+ compilersExpected.add("cs2005q3.2-glibc2.5-i386");
+ compilersExpected.add("cs2007q3-glibc2.5-arm");
+ compilersExpected.add("cs2007q3-glibc2.5-i386");
+
+ ListCompilersCommand listCompilersCommand = new ListCompilersCommand(sb1Command);
+ List<String> compilers = null;
+ try {
+ listCompilersCommand.performCommand(fakeParam);
+ fail("Invalid number of param");
+ } catch (ESboxException e) {
+ // expected
+ }
+ compilers = listCompilersCommand
+ .performCommand(new ArrayList<String>());
+
+ // just make sure there is more than one devkit and that one of them looks like
+ // something we recognize
+ boolean matched = false;
+ for (String compiler : compilers) {
+ assertTrue(compiler.length() > 0);
+ if (compilersExpected.contains(compiler))
+ matched = true;
+ }
+ assertTrue(matched);
+
+ /*
+ for (int i = 0; i < compilersExpected.size(); i++) {
+ assertTrue(compilers.contains(compilersExpected.get(i)));
+ }
+ */
+
+ }
+
+ /**
+ * Test method for
+ * {@link embedded.core.scratchbox.command.ListCputranspCommand#performCommand(java.util.List)}.
+ */
+ public void testListCputranspCommand() throws ESboxException {
+ List<String> fakeParam = new ArrayList<String>();
+ fakeParam.add("param");
+
+ List<String> cputranspExpected = new ArrayList<String>();
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-arm-0.7.0-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-arm-0.8.0-m2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-arm-0.8.0-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-arm-0.8.1-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-arm-0.8.2-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-armeb-0.8.1-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-armeb-0.8.2-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-i386-0.7.0-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-i386-0.8.1-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-i386-0.8.2-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-mips-0.8.1-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-mips-0.8.2-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-mipsel-0.8.1-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-mipsel-0.8.2-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-ppc-0.7.0-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-ppc-0.8.0-m2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-ppc-0.8.1-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-ppc-0.8.2-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-sparc-0.7.0-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-sparc-0.8.1-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-sparc-0.8.2-sb2");
+ cputranspExpected.add("/scratchbox/devkits/cputransp/bin/sbrsh");
+
+ ListCputranspCommand listCputranspCommand = new ListCputranspCommand(sb1Command);
+ List<String> cputransps = null;
+
+ try {
+ listCputranspCommand.performCommand(fakeParam);
+ fail("Invalid number of param");
+ } catch (ESboxException e) {
+ // expected
+ }
+
+ cputransps = listCputranspCommand
+ .performCommand(new ArrayList<String>());
+
+ // just make sure there is more than one devkit and that one of them looks like
+ // something we recognize
+ boolean matched = false;
+ for (String cputransp : cputransps) {
+ assertTrue(cputransp.length() > 0);
+ if (cputranspExpected.contains(cputransp))
+ matched = true;
+ }
+ assertTrue(matched);
+ /*
+ for (int i = 0; i < cputranspExpected.size() && i < cputransp.size(); i++) {
+ assertTrue(cputransp.contains(cputranspExpected.get(i)));
+ }
+ */
+ }
+
+ /**
+ * Test method for
+ * {@link embedded.core.scratchbox.command.ListDevkitsCommand#performCommand(java.util.List)}.
+ */
+ public void testListDevkitsCommand() throws ESboxException {
+ List<String> fakeParam = new ArrayList<String>();
+ fakeParam.add("param");
+
+ List<String> devkitsExpected = new ArrayList<String>();
+ devkitsExpected.add("cputransp");
+ devkitsExpected.add("debian");
+ devkitsExpected.add("debian-sarge");
+ devkitsExpected.add("doctools");
+ devkitsExpected.add("perl");
+
+ ListDevkitsCommand listDevkitsCommand = new ListDevkitsCommand(sb1Command);
+ List<String> devkits = null;
+
+ try {
+ listDevkitsCommand.performCommand(fakeParam);
+ fail("Invalid number of param");
+ } catch (ESboxException e) {
+ // expected
+ }
+
+ devkits = listDevkitsCommand.performCommand(new ArrayList<String>());
+
+ // just make sure there is more than one devkit and that one of them looks like
+ // something we recognize
+ assertTrue(devkits.size() > 1);
+ boolean matched = false;
+ for (String devkit : devkits) {
+ assertTrue(devkit.length() > 0);
+ if (devkitsExpected.contains(devkit)) {
+ matched = true;
+ }
+ }
+ assertTrue(matched);
+ /*
+ for (int i = 0; i < devkitsExpected.size() && i < devkits.size(); i++) {
+ assertTrue(devkits.contains(devkitsExpected.get(i)));
+ }
+ */
+ }
+
+ /**
+ * Test method for
+ * {@link embedded.core.scratchbox.command.ListSessionsCommand#performCommand(java.util.List)}.
+ */
+ public void testListSessionsCommand() throws Exception {
+ if (HostUtils.isWindows()) {
+ System.out.println("PTY support doesn't work, skipping test");
+ return;
+ }
+
+ List<String> fakeParam = new ArrayList<String>();
+ fakeParam.add("param");
+
+ int numberOfSessions = 0;
+
+ ListSessionsCommand listSessionsCommand = new ListSessionsCommand(sb1Command);
+ List<String> sessions = null;
+
+ try {
+ listSessionsCommand.performCommand(fakeParam);
+ fail("Invalid number of param");
+ } catch (ESboxException e) {
+ // expected
+ }
+
+ sessions = listSessionsCommand.performCommand(new ArrayList<String>());
+
+ // make sure anything here is a pid
+ for (String pid : sessions) {
+ Integer.parseInt(pid);
+ }
+
+ numberOfSessions = sessions.size();
+
+ // launch a new session (without switching targets!)
+// ISDKTarget target = ScratchboxFacade.getInstance().getCurrentSDKTarget(ScratchboxSDKFacade.getInstance().getScratchbox1SDK());
+ ISDKTarget target = ScratchboxSDKFacade.getInstance().getScratchboxSDK(Scratchbox1SDK.class).get(0).getCurrentSDKTarget();
+
+ Process process = null;
+ try {
+ // need a PTY or else the shell fails to launch
+ IProcessLauncher launcher = ProcessLauncherCreator.createProcessLauncher(target.getProcessLauncherFactory(), null,
+ Collections.singletonList("/bin/sh"), null);
+ launcher.usePTY(true);
+ process = launcher.createProcess();
+
+ // wait for it to really start
+ Thread.sleep(1000);
+
+ sessions = listSessionsCommand.performCommand(new ArrayList<String>());
+
+ // this either launches 1 or 2 processes
+ assertTrue(numberOfSessions < sessions.size());
+
+ // make sure anything here is a pid
+ for (String pid : sessions) {
+ Integer.parseInt(pid);
+ }
+ } finally {
+ // kill the shell (exit, then send ctrl-d)
+ process.getOutputStream().write("exit\n004\004\004\004\004\004\004\004\004".getBytes());
+ process.destroy();
+ }
+
+ }
+
+ /**
+ * Test method for
+ * {@link embedded.core.scratchbox.command.ListTargetsCommand#performCommand(java.util.List)}.
+ */
+ public void testListTargetsCommand() throws ESboxException {
+ List<String> fakeParam = new ArrayList<String>();
+ fakeParam.add("param");
+
+ List<String> targetsExpected = new ArrayList<String>();
+ targetsExpected.add("SDK_ARMEL");
+ targetsExpected.add("SDK_X86");
+ targetsExpected.add("BORA_ARMEL");
+ targetsExpected.add("BORA_X86");
+ targetsExpected.add("CHINOOK_ARMEL");
+ targetsExpected.add("CHINOOK_X86");
+ targetsExpected.add("DIABLO_ARMEL");
+
+ ListTargetsCommand listTargetsCommand = new ListTargetsCommand(sb1Command);
+ List<String> targets = null;
+
+ try {
+ listTargetsCommand.performCommand(fakeParam);
+ fail("Invalid number of param");
+ } catch (ESboxException e) {
+ // expected
+ }
+
+ targets = listTargetsCommand.performCommand(new ArrayList<String>());
+
+ // just make sure there is more than one target and that one of them looks like
+ // something we recognize
+ assertTrue(targets.size() > 1);
+ boolean matched = false;
+ for (String target : targets) {
+ assertTrue(target.length() > 0);
+ if (targetsExpected.contains(target)) {
+ matched = true;
+ }
+ }
+ assertTrue(matched);
+ /*
+ for (int i = 0; i < targetsExpected.size() && i < targets.size(); i++) {
+ assertTrue(targets.contains(targetsExpected.get(i)));
+ }
+ */
+ }
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestListSb2Commands.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestListSb2Commands.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestListSb2Commands.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,229 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.maemo.esbox.internal.scratchbox.sb2.command.*;
+import org.maemo.esbox.scratchbox.sb2.sdk.MaemoRootstrap;
+import org.maemo.mica.common.core.*;
+import org.maemo.mica.common.core.env.IEnvironmentModifierBlock;
+import org.maemo.mica.common.core.machine.IFileSystemAccess;
+import org.maemo.mica.common.core.process.IProcessLauncher;
+import org.maemo.mica.common.core.process.IProcessLauncherFactory;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.*;
+
+/**
+ */
+public class TestListSb2Commands extends BaseTest {
+ private final String COMPILER = "arm-none-linux-gnueabi-gcc";
+
+ public void testListCompilersCommand() throws ESboxException {
+ List<String> fakeParam = new ArrayList<String>();
+ fakeParam.add("fake");
+
+ List<String> compilersExpected = new ArrayList<String>();
+ compilersExpected.add(COMPILER);
+
+ ListCompilersSb2Command listCompilersCommand = new ListCompilersSb2Command(sb2Command);
+ List<String> compilers = null;
+ try {
+ listCompilersCommand.performCommand(fakeParam);
+ fail("Invalid number of param");
+ } catch (ESboxException e) {
+ // expected
+ }
+ compilers = listCompilersCommand
+ .performCommand(new ArrayList<String>());
+
+ // just make sure there is more than one devkit and that one of them looks like
+ // something we recognize
+ boolean matched = false;
+ for (String compiler : compilers) {
+ assertTrue(compiler.length() > 0);
+ assertTrue(sb2Sdk.getMachineFileSystemAccess().getFileStore(new Path(compiler)).fetchInfo().exists());
+ for (String exp : compilersExpected) {
+ if (compiler.endsWith(exp)) {
+ matched = true;
+ break;
+ }
+ }
+ }
+ assertTrue(matched);
+ }
+
+ /**
+ * Test method for
+ * {@link embedded.core.scratchbox.command.ListCputranspCommand#performCommand(java.util.List)}.
+ */
+ public void testListCputranspCommand() throws ESboxException {
+ List<String> fakeParam = new ArrayList<String>();
+ fakeParam.add("param");
+
+ List<String> cputranspExpected = new ArrayList<String>();
+ cputranspExpected
+ .add("sb2-qemu-arm");
+ cputranspExpected
+ .add("sbrsh");
+
+ ListCputranspSb2Command listCputranspCommand = new ListCputranspSb2Command(sb2Command);
+ List<String> cputransps = null;
+
+ try {
+ listCputranspCommand.performCommand(fakeParam);
+ fail("Invalid number of param");
+ } catch (ESboxException e) {
+ // expected
+ }
+
+ cputransps = listCputranspCommand
+ .performCommand(new ArrayList<String>());
+
+ // just make sure there is more than one devkit and that one of them looks like
+ // something we recognize
+ boolean matched = false;
+ for (String cputransp : cputransps) {
+ assertTrue(cputransp.length() > 0);
+ assertTrue(sb2Sdk.getMachineFileSystemAccess().getFileStore(new Path(cputransp)).fetchInfo().exists());
+ for (String exp : cputranspExpected) {
+ if (cputransp.endsWith(exp)) {
+ matched = true;
+ break;
+ }
+ }
+ }
+ assertTrue(matched);
+ }
+
+
+ /**
+ * Test method for
+ * {@link embedded.core.scratchbox.command.ListTargetsCommand#performCommand(java.util.List)}.
+ */
+ public void testListTargetsCommand() throws ESboxException {
+ List<String> fakeParam = new ArrayList<String>();
+ fakeParam.add("param");
+
+ List<String> targetsExpected = new ArrayList<String>();
+ targetsExpected.add("bora31_armel");
+ targetsExpected.add("chinook40_armel");
+ targetsExpected.add("diablo41_armel");
+
+ ListTargetsCommand listTargetsCommand = new ListTargetsCommand(sb2Command);
+ List<String> targets = null;
+
+ try {
+ listTargetsCommand.performCommand(fakeParam);
+ fail("Invalid number of param");
+ } catch (ESboxException e) {
+ // expected
+ }
+
+ targets = listTargetsCommand.performCommand(new ArrayList<String>());
+
+ // just make sure there is at least one target and that one of them looks like
+ // something we recognize
+ assertTrue(targets.size() > 0);
+ boolean matched = false;
+ for (String target : targets) {
+ assertTrue(target.length() > 0);
+ if (targetsExpected.contains(target)) {
+ matched = true;
+ }
+ }
+ assertTrue(matched);
+ }
+
+ public void testListAvailableRootstrapsCommand() throws ESboxException {
+ List<String> fakeParam = new ArrayList<String>();
+ fakeParam.add("param");
+
+ List<String> targetsExpected = new ArrayList<String>();
+ targetsExpected.add("bora31_armel");
+ targetsExpected.add("chinook40_armel");
+
+ ListAvailableMaemoRootstrapsSb2Command listRootstrapsCommand
+ = new ListAvailableMaemoRootstrapsSb2Command(sb2Command);
+ List<MaemoRootstrap> rootstraps = null;
+
+ try {
+ listRootstrapsCommand.performCommand(fakeParam);
+ fail("Invalid number of param");
+ } catch (ESboxException e) {
+ // expected
+ }
+
+ IPreferenceStore store = CorePreferenceConstants.getPreferenceStore();
+ store.setValue(CorePreferenceConstants.LOG_COMMANDS.toString(), true);
+ store.setValue(CorePreferenceConstants.LOG_COMMANDS_PATH.toString(),
+ HostUtils.getTemporaryPath().append("esbox_commands.txt").toOSString());
+ try {
+ rootstraps = listRootstrapsCommand.performCommand(new ArrayList<String>());
+ } catch (ESboxException e) {
+ // try again with proxy, manually set -- the JUnit workspace is prolly empty.
+
+ ICommandAbstractor altCommandAbstractor = new ICommandAbstractor() {
+
+ public String getPreferenceValue(String key) {
+ return sb2Command.getPreferenceValue(key);
+ }
+
+ public IProcessLauncherFactory getProcessLauncherFactory() {
+ final IProcessLauncherFactory factory = sb2Command.getProcessLauncherFactory();
+ return new IProcessLauncherFactory() {
+
+ public IProcessLauncher createProcessLauncher(
+ IPath workingDirectory,
+ List<String> commandLine,
+ IEnvironmentModifierBlock environment) {
+ return factory.createProcessLauncher(workingDirectory, commandLine, environment);
+ }
+
+ public IEnvironmentModifierBlock defaultEnvironmentModifierBlock() {
+ return factory.defaultEnvironmentModifierBlock();
+ }
+ public Properties getRawEnvironment() {
+ return factory.getRawEnvironment();
+ }
+ };
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.esbox.internal.common.core.command.ICommandAbstractor#getFileSystemAccess()
+ */
+ public IFileSystemAccess getFileSystemAccess() {
+ return sb2Sdk.getMachineFileSystemAccess();
+ }
+
+ };
+
+ listRootstrapsCommand = new ListAvailableMaemoRootstrapsSb2Command(altCommandAbstractor);
+ rootstraps = listRootstrapsCommand.performCommand(new ArrayList<String>());
+ }
+
+ // just make sure there is more than one rootstrap and that one of them looks like
+ // something we recognize
+ assertTrue(rootstraps.size() > 0);
+ boolean matched = false;
+ for (MaemoRootstrap rootstrap : rootstraps) {
+ assertTrue(rootstrap.getName().length() > 0);
+ assertTrue(rootstrap.getArchitecture().length() > 0);
+ assertTrue(rootstrap.getDescription().length() > 0);
+ if (targetsExpected.contains(rootstrap.getName())) {
+ matched = true;
+ }
+ }
+ assertTrue(matched);
+ }
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestRemoveCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestRemoveCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestRemoveCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import org.maemo.esbox.internal.api.scratchbox.core.commands.ScratchboxInvalidOperationException;
+import org.maemo.esbox.internal.scratchbox.sb1.command.RemoveTargetCommand;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxCommand;
+import org.maemo.mica.common.core.ESboxException;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Please, read file TESTS.txt for more instructions about test.
+ */
+public class TestRemoveCommand extends BaseTest {
+
+ /**
+ * Test method for
+ * {@link embedded.core.scratchbox.command.RemoveTargetCommand#performCommand(java.util.List)}.
+ *
+ * @throws ESboxException
+ * @throws ScratchboxInvalidOperationException
+ */
+ public void testPerformCommand() throws ESboxException {
+ final String TARGET_DOESNT_EXIST = "GHOST";
+ ScratchboxCommand removeCommand = new RemoveTargetCommand(sb1Sdk, sb1Command);
+
+ List<String> param = new ArrayList<String>();
+
+ try {
+ removeCommand.performCommand(param);
+ fail("Invalid number of param");
+ } catch (ESboxException e) {
+ // TODO: handle exception
+ }
+
+ param.add(TARGET_DOESNT_EXIST);
+
+ try {
+ removeCommand.performCommand(param);
+ fail("The target " + TARGET_DOESNT_EXIST
+ + " does not exist. An error must be throwed.");
+ } catch (ESboxException e) {
+ // the test is OK, so far.
+ }
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestRemoveSb2Command.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestRemoveSb2Command.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestRemoveSb2Command.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import org.maemo.esbox.internal.api.scratchbox.core.sdk.CacheUtils;
+import org.maemo.esbox.internal.scratchbox.sb2.command.RemoveTargetSb2Command;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxCommand;
+import org.maemo.mica.common.core.ESboxException;
+
+import java.util.*;
+
+/**
+ */
+public class TestRemoveSb2Command extends BaseTest {
+
+ public void testPerformCommand() throws ESboxException {
+ final String TARGET_DOESNT_EXIST = "GHOST";
+ ScratchboxCommand removeCommand = new RemoveTargetSb2Command(sb2Sdk, sb2Command);
+
+ List<String> param = new ArrayList<String>();
+
+ try {
+ removeCommand.performCommand(param);
+ fail("Invalid number of param");
+ } catch (ESboxException e) {
+ // TODO: handle exception
+ }
+
+ param.add(TARGET_DOESNT_EXIST);
+
+ try {
+ removeCommand.performCommand(param);
+ fail("The target " + TARGET_DOESNT_EXIST
+ + " does not exist. An error must be throwed.");
+ } catch (ESboxException e) {
+ // the test is OK, so far.
+ }
+ }
+
+ public void testRemoveRealTarget() throws Exception {
+ final String TARGET = "REMOVEME_armel";
+
+ try {
+ sb2Sdk.createTarget(TARGET,sb2Sdk.getCompilers().get(0), null,null);
+ } catch (ESboxException e) {
+ // don't worry if it fails, as it might, since installing a
+ // bogus target in sb2 often fails to initialize properly
+ }
+
+ List<String> targets = new ArrayList<String>();
+ try {
+ targets = sb2Sdk.getTargets();
+ } catch (ESboxException e) {
+ // again, ignore error
+ }
+
+ if (targets.contains(TARGET)) {
+ ScratchboxCommand removeCommand = new RemoveTargetSb2Command(sb2Sdk, sb2Command);
+
+ List<String> param = Collections.singletonList(TARGET);
+ try {
+ CacheUtils.getInstance().clearCachedData();
+ removeCommand.performCommand(param);
+
+ CacheUtils.getInstance().clearCachedData();
+ targets = sb2Sdk.getTargets();
+ assertFalse(targets.contains(TARGET));
+ } catch (ESboxException e) {
+ throw e;
+ }
+ }
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestResetTargetCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestResetTargetCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestResetTargetCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests.commands;
+
+
+
+/**
+ * Please, read file TESTS.txt for more instructions about test.
+ */
+public class TestResetTargetCommand extends BaseTest {
+
+ /**
+ * Test method for
+ * {@link embedded.core.scratchbox.command.ResetTargetCommand#performCommand(java.util.List)}.
+ */
+ public void testPerformCommand() {
+
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestRootstrapCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestRootstrapCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestRootstrapCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests.commands;
+
+
+
+/**
+ * Please, read file TESTS.txt for more instructions about test.
+ */
+public class TestRootstrapCommand extends BaseTest {
+
+ /**
+ * Test method for
+ * {@link embedded.core.scratchbox.command.RootstrapCommand#performCommand(java.util.List)}.
+ */
+ public void testPerformCommand() {
+
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchboxCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchboxCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchboxCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import org.maemo.esbox.internal.scratchbox.sb1.command.AbstractSB1Command;
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.List;
+
+/**
+ * Please, read file TESTS.txt for more instructions about test.
+ */
+public class TestScratchboxCommand extends BaseTest {
+
+ /**
+ * Mock class to test ScratchboxCommand abstract class.
+ *
+ * @author Raul Fernandes Herbster - raulherbster at gmail dot com
+ */
+ class MockScratchboxCommand extends AbstractSB1Command {
+
+
+ public MockScratchboxCommand(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ public Object performCommand(List<String> param)
+ throws ESboxException {
+ return null;
+ }
+
+ @Override
+ public int getParametersSize() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+
+
+
+ }
+
+ /**
+ * Test method for
+ * {@link embedded.core.scratchbox.command.ScratchboxCommand#replaceScratchboxCommand(java.lang.String, java.lang.String, java.lang.String[])}.
+ */
+ public void testReplaceScratchboxCommandStringStringStringArray() {
+ final String stringToCompareA = "sb-conf current";
+ String currentTargetAction = sb1Sdk.getPreferenceValue(
+ SB1PreferenceConstants.SB1_CURRENT_ACT);
+ AbstractSB1Command scratchboxCommandA = new MockScratchboxCommand(sb1Command);
+
+ String stringGetCurrent = scratchboxCommandA
+ .replaceScratchboxConfigCommand(currentTargetAction);
+ assertEquals(stringToCompareA, stringGetCurrent.trim());
+
+ }
+
+ /**
+ * Test method for
+ * {@link embedded.core.scratchbox.command.ScratchboxCommand#replaceScratchboxConfigCommand(java.lang.String, java.lang.String)}.
+ */
+ public void testReplaceScratchboxCommandStringString() {
+ final String stringToCompareA = "sb-conf show --compilers --devkits --cputransp";
+
+ String showAction = sb1Sdk.getPreferenceValue(
+ SB1PreferenceConstants.SB1_SHOW_ACT);
+ String compilersShowOption = sb1Sdk.getPreferenceValue(
+ SB1PreferenceConstants.SB1_SHOW_OPT_COMPILERS);
+ String devkitsShowOption = sb1Sdk.getPreferenceValue(
+ SB1PreferenceConstants.SB1_SHOW_OPT_DEVKITS);
+ String cpuTranspShowOption = sb1Sdk.getPreferenceValue(
+ SB1PreferenceConstants.SB1_SHOW_OPT_CPU);
+ AbstractSB1Command scratchboxCommandA = new MockScratchboxCommand(sb1Command);
+
+ String stringShow = scratchboxCommandA.replaceScratchboxConfigCommand(
+ showAction, new String[] { compilersShowOption,
+ devkitsShowOption, cpuTranspShowOption });
+ assertEquals(stringToCompareA, stringShow.trim());
+
+ final String stringToCompareB = "sb-conf remove SDK_ARMEL";
+ String removeAction = sb1Sdk.getPreferenceValue(
+ SB1PreferenceConstants.SB1_REMOVE_ACT);
+ String stringRemove = scratchboxCommandA
+ .replaceScratchboxConfigCommand(removeAction,
+ new String[] { "SDK_ARMEL" });
+ assertEquals(stringToCompareB, stringRemove);
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchboxFacade.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchboxFacade.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchboxFacade.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,527 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import org.junit.Test;
+import org.maemo.esbox.internal.scratchbox.sb1.core.Scratchbox1SDK;
+import org.maemo.esbox.internal.scratchbox.sb2.core.Scratchbox2SDK;
+import org.maemo.esbox.scratchbox.core.sdk.ScratchboxSDKFacade;
+import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDK;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.HostUtils;
+import org.maemo.mica.common.core.machine.IMachine;
+import org.maemo.mica.common.core.machine.MachineRegistry;
+import org.maemo.mica.common.core.process.IProcessLauncher;
+import org.maemo.mica.common.core.process.ProcessLauncherCreator;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+
+import java.util.*;
+
+import junit.framework.TestCase;
+
+/**
+ * Please, read file TESTS.txt for more instructions about test.
+ */
+public class TestScratchboxFacade extends TestCase {
+
+ private IScratchbox1SDK sdk;
+ static private List<String> cachedCputransps;
+ static private List<String> cachedCompilers;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ this.sdk = ScratchboxSDKFacade.getInstance().getScratchboxSDK(IScratchbox1SDK.class).get(0);
+ }
+
+ /**
+ * Test method for
+ * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#getInstance()}.
+ */
+// @Test
+// public void testGetInstance() {
+// ScratchboxFacade facadeA = ScratchboxFacade.getInstance();
+// ScratchboxFacade facadeB = ScratchboxFacade.getInstance();
+// assertSame(facadeA, facadeB);
+// }
+
+ /**
+ * Test method for
+ * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#getCompilers()}.
+ *
+ * @throws ESboxException
+ */
+ @Test
+ public void testGetCompilers() throws ESboxException {
+ List<String> compilersExpected = new ArrayList<String>();
+ compilersExpected.add("host-gcc");
+ compilersExpected.add("cs2005q3.2-glibc-arm");
+ compilersExpected.add("cs2005q3.2-glibc-i386");
+ compilersExpected.add("cs2005q3.2-glibc2.5-arm");
+ compilersExpected.add("cs2005q3.2-glibc2.5-i386");
+
+ List<String> compilers = getCompilers();
+
+ // just make sure there is at least one compiler and that one of them looks like
+ // something we recognize
+ boolean matched = false;
+ for (String compiler : compilers) {
+ assertTrue(compiler.length() > 0);
+ if (compilers.contains(compiler))
+ matched = true;
+ }
+ assertTrue(matched);
+ /*
+ for (int i = 0; i < compilersExpected.size(); i++) {
+ assertTrue(compilers.contains(compilersExpected.get(i)));
+ }
+ */
+ }
+
+ /**
+ * @return
+ * @throws ESboxException
+ */
+ private List<String> getCompilers() throws ESboxException {
+ if (cachedCompilers == null)
+ cachedCompilers = sdk.getCompilers();//ScratchboxFacade.getInstance().getCompilers(sdk);
+ List<String> compilers = cachedCompilers;
+ return compilers;
+ }
+
+ /**
+ * Test method for
+ * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#getCputransp()}.
+ *
+ * @throws ESboxException
+ */
+ @Test
+ public void testGetCputransp() throws ESboxException {
+ List<String> cputranspExpected = new ArrayList<String>();
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-arm-0.7.0-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-arm-0.8.0-m2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-arm-0.8.0-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-arm-0.8.1-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-arm-0.8.2-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-armeb-0.8.1-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-armeb-0.8.2-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-i386-0.7.0-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-i386-0.8.1-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-i386-0.8.2-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-mips-0.8.1-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-mips-0.8.2-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-mipsel-0.8.1-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-mipsel-0.8.2-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-ppc-0.7.0-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-ppc-0.8.0-m2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-ppc-0.8.1-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-ppc-0.8.2-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-sparc-0.7.0-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-sparc-0.8.1-sb2");
+ cputranspExpected
+ .add("/scratchbox/devkits/cputransp/bin/qemu-sparc-0.8.2-sb2");
+ cputranspExpected.add("/scratchbox/devkits/cputransp/bin/sbrsh");
+
+ List<String> cputransps = getCputransps();
+
+ // just make sure there is at least one cuptransp and that one of them looks like
+ // something we recognize
+ boolean matched = false;
+ for (String cputransp : cputransps) {
+ assertTrue(cputransp.length() > 0);
+ if (cputranspExpected.contains(cputransp))
+ matched = true;
+ }
+ assertTrue(matched);
+ /*
+ for (int i = 0; i < cputranspExpected.size() && i < cputransp.size(); i++) {
+ assertTrue(cputransp.contains(cputranspExpected.get(i)));
+ }
+ */
+ }
+
+ /**
+ * @return
+ * @throws ESboxException
+ */
+ private List<String> getCputransps() throws ESboxException {
+ if (cachedCputransps == null)
+ cachedCputransps = sdk.getCputransp();//ScratchboxFacade.getInstance().getCputransp(sdk);
+ List<String> cputransps = cachedCputransps;
+ return cputransps;
+ }
+
+ /**
+ * Test method for
+ * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#getDevkits()}.
+ *
+ * @throws ESboxException
+ */
+ @Test
+ public void testGetDevkits() throws ESboxException {
+ List<String> devkitsExpected = new ArrayList<String>();
+ devkitsExpected.add("cputransp");
+ devkitsExpected.add("debian");
+ devkitsExpected.add("debian-sarge");
+ devkitsExpected.add("doctools");
+ devkitsExpected.add("perl");
+
+ List<String> devkits = ((IScratchbox1SDK)sdk).getDevkits();//ScratchboxFacade.getInstance().getDevkits(sdk);
+
+ // just make sure there is at leasr one devkit and that one of them looks like
+ // something we recognize
+ assertTrue(devkits.size() > 1);
+ boolean matched = false;
+ for (String devkit : devkits) {
+ assertTrue(devkit.length() > 0);
+ if (devkitsExpected.contains(devkit)) {
+ matched = true;
+ }
+ }
+ assertTrue(matched);
+ /*
+ for (int i = 0; i < devkitsExpected.size() && i < devkits.size(); i++) {
+ assertTrue(devkits.contains(devkitsExpected.get(i)));
+ }
+ */
+ }
+
+ /**
+ * Test method for
+ * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#getTargets()}.
+ *
+ * @throws ESboxException
+ */
+ @Test
+ public void testGetTargets() throws ESboxException {
+ List<String> targetsExpected = new ArrayList<String>();
+ targetsExpected.add("SDK_ARMEL");
+ targetsExpected.add("SDK_X86");
+ targetsExpected.add("BORA_ARMEL");
+ targetsExpected.add("BORA_X86");
+ targetsExpected.add("CHINOOK_ARMEL");
+ targetsExpected.add("CHINOOK_X86");
+ targetsExpected.add("DIABLO_X86");
+ targetsExpected.add("DIABLO_ARMEL");
+
+ List<String> targets = sdk.getTargets();//ScratchboxFacade.getInstance().getTargets(sdk);
+
+ // just make sure there is more than one target and that one of them looks like
+ // something we recognize
+ assertTrue(targets.size() > 1);
+ boolean matched = false;
+ for (String target : targets) {
+ assertTrue(target.length() > 0);
+ if (targetsExpected.contains(target)) {
+ matched = true;
+ }
+ }
+ assertTrue(matched);
+
+ /*
+ for (int i = 0; i < targetsExpected.size() && i < targets.size(); i++) {
+ assertTrue(targets.contains(targetsExpected.get(i)));
+ }*/
+ }
+
+ /**
+ * Test method for
+ * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#getSessions()}.
+ *
+ * @throws ESboxException
+ */
+ @Test
+ public void testGetSessions() throws Exception {
+ if (HostUtils.isWindows()) {
+ System.out.println("PTY support doesn't work, skipping test");
+ return;
+ }
+
+ int numberOfSessions = 0;
+
+// List<String> sessions = ScratchboxFacade.getInstance().getSessions(sdk);
+ List<String> sessions = sdk.getSessions();
+
+ // make sure anything here is a pid
+ for (String pid : sessions) {
+ Integer.parseInt(pid);
+ }
+
+ numberOfSessions = sessions.size();
+
+ // launch a new session (without switching targets!)
+// ISDKTarget target = ScratchboxFacade.getInstance().getCurrentSDKTarget(ScratchboxSDKFacade.getInstance().getScratchbox1SDK());
+ ISDKTarget target = ScratchboxSDKFacade.getInstance().getScratchboxSDK(Scratchbox1SDK.class).get(0).getCurrentSDKTarget();
+ Process process = null;
+ try {
+ // need a PTY or else the shell fails to launch
+ IProcessLauncher launcher = ProcessLauncherCreator.createProcessLauncher(target.getProcessLauncherFactory(), null,
+ Collections.singletonList("/bin/sh"), null);
+ launcher.usePTY(true);
+ process = launcher.createProcess();
+
+ // wait for it to really start
+ Thread.sleep(5000);
+
+ sessions = sdk.getSessions();// ScratchboxFacade.getInstance().getSessions(sdk);
+
+ // this either launches 1 or 2 processes
+ assertTrue(numberOfSessions < sessions.size());
+
+ // make sure anything here is a pid
+ for (String pid : sessions) {
+ Integer.parseInt(pid);
+ }
+ } catch (Exception e) {
+ fail("Exception: "+e.getMessage());
+ }finally {
+ // kill the shell (exit, then send ctrl-d)
+ process.getOutputStream().write("exit\n004\004\004\004\004\004\004\004\004".getBytes());
+ process.destroy();
+ }
+ }
+
+ /**
+ * Test method for
+ * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#getCurrentTarget()}.
+ *
+ * @throws ESboxException
+ */
+ @Test
+ public void testGetCurrentTarget() throws ESboxException {
+ String currentTarget = sdk.getCurrentTarget();//ScratchboxFacade.getInstance().getCurrentTarget(sdk);
+ assertTrue(currentTarget.length() > 0);
+ assertNotNull(sdk.findSDKTarget(currentTarget));
+ }
+
+ /**
+ * Test method for
+ * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#createTarget(java.lang.String, java.lang.String, java.lang.String, java.lang.String)}.
+ * and
+ * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#removeTarget(java.lang.String)}.
+ *
+ * @throws ESboxException
+ */
+ @Test
+ public void testCreateAndRemoveTarget() throws ESboxException {
+ final String TARGET_NAME = "TEST_TARGET";
+
+ // pick actual compiler and cputransp
+ List<String> compilers = getCompilers();
+ String compiler = "host-gcc";
+ for (String c : compilers) {
+ if (c.matches("cs2005.*arm")) {
+ compiler = c;
+ break;
+ }
+ }
+ List<String> cputransps = getCputransps();
+ String cputransp = "sbrsh";
+ for (String c : cputransps) {
+ if (c.matches("qemu.*arm.*sb2")) {
+ cputransp = c;
+ break;
+ }
+ }
+
+
+ sdk.createTarget(
+ TARGET_NAME,
+ compiler,
+ "doctools:cputransp",
+ cputransp);
+
+ List<String> targetsAvailable = sdk.getTargets();//ScratchboxFacade.getInstance().getTargets(sdk);
+ assertTrue(targetsAvailable.contains(TARGET_NAME));
+
+ // remove the target created for the test
+// assertTrue(ScratchboxFacade.getInstance().removeTarget(sdk, TARGET_NAME));
+ assertTrue(sdk.removeTarget(TARGET_NAME));
+
+ targetsAvailable = sdk.getTargets();//ScratchboxFacade.getInstance().getTargets(sdk);
+ assertTrue(!targetsAvailable.contains(TARGET_NAME));
+ }
+
+ /**
+ * Test method for
+ * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#selectTarget(java.lang.String)}.
+ *
+ * @throws ESboxException
+ */
+ @Test
+ public void testSelectTarget() throws ESboxException {
+ final String TARGET_DOESNT_EXIST = "GHOST";
+
+ try {
+// ScratchboxFacade.getInstance().removeTarget(sdk, TARGET_DOESNT_EXIST);
+ sdk.removeTarget(TARGET_DOESNT_EXIST);
+ fail("The target " + TARGET_DOESNT_EXIST
+ + " does not exist. An error must be throwed.");
+ } catch (ESboxException e) {
+ // the test is OK, so far.
+ }
+
+ // find a known target which isn't the current one
+ List<String> targets = sdk.getTargets();//ScratchboxFacade.getInstance().getTargets(sdk);
+
+ String currentTarget = sdk.getCurrentTarget();//ScratchboxFacade.getInstance().getCurrentTarget(sdk);
+
+ String theTarget = null;
+ for (String target : targets) {
+ if (!target.equals(currentTarget)) {
+ theTarget = target;
+ break;
+ }
+ }
+
+ String lastTarget = sdk.getCurrentTarget();//ScratchboxFacade.getInstance().getCurrentTarget(sdk);
+ assertTrue(lastTarget != null && lastTarget.length() > 0);
+
+// assertTrue(ScratchboxFacade.getInstance().selectTarget(sdk, theTarget));
+ assertTrue(sdk.selectTarget(theTarget));
+
+ currentTarget = sdk.getCurrentTarget();//ScratchboxFacade.getInstance().getCurrentTarget(sdk);
+ assertEquals(theTarget, currentTarget);
+ }
+
+ /**
+ * Test method for
+ * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#getCurrentSbox1Version()}.
+ *
+ * @throws ESboxException
+ */
+ @Test
+ public void testGetCurrentSboxVersion() {
+ for (IMachine machine : MachineRegistry.getInstance().getBuildMachines()) {
+ String sbox1Version;
+ try {
+ sbox1Version = Scratchbox1SDK.getCurrentSboxVersion(machine);//ScratchboxFacade.getInstance().getCurrentSbox1Version(machine);
+ assertTrue(sbox1Version.matches("1\\.0\\.\\d+"));
+ } catch (ESboxException e) {
+ System.out.println("No Scratchbox 1 on " + machine);
+ }
+ String sbox2Version;
+ try {
+ sbox2Version = Scratchbox2SDK.getCurrentSboxVersion(machine);//ScratchboxFacade.getInstance().getCurrentSbox1Version(machine);
+ assertTrue(sbox2Version.matches("1\\.99\\..*|2\\..*"));
+ } catch (ESboxException e) {
+ System.out.println("No Scratchbox 2 on " + machine);
+ }
+ }
+ }
+
+ /**
+ * Test method for
+ * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#configureSbrsh(java.lang.String, java.lang.String, java.lang.String)}.
+ */
+ @Test
+ public void testConfigureSbrsh() {
+ // fail("Not yet implemented");
+ }
+
+ /**
+ * Test method for
+ * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#addSbrshAccessList(java.lang.String, java.lang.String, java.lang.String)}.
+ */
+ @Test
+ public void testAddSbrshAccessList() {
+ // fail("Not yet implemented");
+ }
+
+ /**
+ * Test method for
+ * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#mountTarget(java.lang.String)}.
+ */
+ @Test
+ public void testMountTarget() {
+ // fail("Not yet implemented");
+ }
+
+ /**
+ * Test method for
+ * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#unmountTarget(java.lang.String)}.
+ */
+ @Test
+ public void testUnmountTarget() {
+ // fail("Not yet implemented");
+ }
+
+ /**
+ * Test method for
+ * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#showTarget(java.lang.String)}.
+ *
+ * @throws ESboxException
+ */
+ /*
+ @Test
+ public void testShowTarget() throws ESboxException {
+ final String TARGET_ARMEL = "SDK_ARMEL";
+
+ ScratchboxTarget target = ScratchboxFacade.getInstance().showTarget(sdk,
+ TARGET_ARMEL);
+
+ assertEquals(TARGET_ARMEL, target.getName());
+ assertEquals("cs2005q3.2-glibc-arm", target.getCompiler());
+ assertEquals("/scratchbox/devkits/cputransp/bin/qemu-arm-0.8.2-sb2",
+ target.getCputransp());
+
+ List<String> devkitsExpected = new ArrayList<String>();
+ devkitsExpected.add("perl");
+ devkitsExpected.add("maemo3-tools");
+ devkitsExpected.add("doctools");
+ devkitsExpected.add("debian-sarge");
+ devkitsExpected.add("maemo3-debian");
+ devkitsExpected.add("cputransp");
+
+ List<String> devkitsActual = target.getDevkits();
+ for (String devkit : devkitsActual) {
+ assertTrue(devkitsExpected.contains(devkit));
+ }
+ }
+ */
+
+ /**
+ * Test method for
+ * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#execSimpleCommand(java.lang.String)}.
+ *
+ * @throws ESboxException
+ */
+// @Test
+// public void testExecSimpleCommand() throws ESboxException {
+// ISDKTarget sdkTarget = sdk.getSDKTargets()[0];
+// List<String> currentTarget = ScratchboxFacade.getInstance().execSimpleCommand(
+// sdkTarget,
+// CommandLineArguments.createFromVarArgs("sb-conf", "current"));
+// assertEquals(sdkTarget.getName(), currentTarget.get(0));
+// }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestSelectTargetCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestSelectTargetCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestSelectTargetCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import org.maemo.esbox.internal.scratchbox.sb1.command.*;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxCommand;
+import org.maemo.mica.common.core.ESboxException;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Please, read file TESTS.txt for more instructions about test.
+ */
+public class TestSelectTargetCommand extends BaseTest {
+
+ public void testPerformCommand() throws ESboxException {
+ final String TARGET_DOESNT_EXIST = "GHOST";
+
+
+ ScratchboxCommand selectCommand = new SelectTargetCommand(sb1Command, sb1Sdk);
+
+ List<String> param = new ArrayList<String>();
+
+ try {
+ selectCommand.performCommand(param);
+ fail("Invalid number of param");
+ } catch (ESboxException e) {
+ // the test is OK, so far.
+ }
+
+ param.add(TARGET_DOESNT_EXIST);
+
+ try {
+ selectCommand.performCommand(param);
+ fail("The target " + TARGET_DOESNT_EXIST
+ + " does not exist. An error must be throwed.");
+ } catch (ESboxException e) {
+ // the test is OK, so far.
+ }
+
+ // find a known target which isn't the current one
+ ListTargetsCommand listTargets = new ListTargetsCommand(sb1Command);
+ param.clear();
+ List<String> targets = listTargets.performCommand(param);
+
+ GetCurrentTargetCommand currentTargetCommand = new GetCurrentTargetCommand(sb1Command, sb1Sdk);
+ String currentTarget = currentTargetCommand.performCommand(param);
+ String firstTarget = currentTarget;
+
+ String theTarget = null;
+ for (String target : targets) {
+ if (!target.equals(currentTarget)) {
+ theTarget = target;
+ break;
+ }
+ }
+
+ // switch to the other target
+ ScratchboxCommand selectTargetCommand = new SelectTargetCommand(sb1Command, sb1Sdk);
+ param.clear();
+ param.add(theTarget);
+ assertTrue((Boolean) selectTargetCommand.performCommand(param));
+
+ String lastTarget = currentTargetCommand
+ .performCommand(new ArrayList<String>());
+ assertEquals(theTarget, lastTarget);
+
+ // siwtch back to the original target
+ param.clear();
+ param.add(currentTarget);
+ assertTrue((Boolean) selectTargetCommand.performCommand(param));
+
+ currentTarget = currentTargetCommand
+ .performCommand(new ArrayList<String>());
+ assertEquals(firstTarget, currentTarget);
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestShowPathMappingSb2Command.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestShowPathMappingSb2Command.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestShowPathMappingSb2Command.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,45 @@
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import org.eclipse.core.runtime.IPath;
+import org.maemo.esbox.internal.scratchbox.sb2.command.ShowPathMappingSb2Command;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.machine.IFileSystemAccess;
+
+import java.util.*;
+
+public class TestShowPathMappingSb2Command extends BaseTest {
+
+ public void testPerformCommand() throws ESboxException {
+ if (sb2ArmelTargetCommand == null)
+ return;
+
+ ShowPathMappingSb2Command showPathsCommand = new ShowPathMappingSb2Command(
+ sb2ArmelTargetCommand);
+
+ List<String> param = new ArrayList<String>();
+
+ param.add("/");
+ param.add("/var/log");
+ param.add("/usr/include");
+ param.add("/usr/lib/libc.so");
+ param.add("/home");
+
+ Map<IPath, IPath> mapping = showPathsCommand.performCommand(param);
+
+ assertNotNull(mapping);
+
+ assertEquals(param.size(), mapping.size());
+
+ IFileSystemAccess fileSystemAccess = sb2Sdk.getMachineFileSystemAccess();
+ for (Map.Entry<IPath, IPath> entry : mapping.entrySet()) {
+ if (fileSystemAccess.getFileStore(entry.getKey()).fetchInfo().exists()) {
+ assertNotNull(entry.getValue());
+ assertTrue(entry.getKey().toOSString(), param.contains(entry.getKey().toPortableString()));
+ assertTrue(entry.getValue().toString(),
+ fileSystemAccess.getFileStore(entry.getValue()).fetchInfo().exists()
+ );
+ }
+ }
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestShowTargetCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestShowTargetCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestShowTargetCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import org.maemo.esbox.internal.scratchbox.sb1.command.ShowTargetCommand;
+import org.maemo.esbox.internal.scratchbox.sb1.core.Scratchbox1SDK;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxCommand;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxTarget;
+import org.maemo.mica.common.core.ESboxException;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Please, read file TESTS.txt for more instructions about test.
+ */
+public class TestShowTargetCommand extends BaseTest {
+
+ public void testPerformCommand() throws ESboxException {
+ String theTarget = sb1Sdk.getSDKTargetNames()[0];
+
+ ScratchboxCommand showTargetCommand = new ShowTargetCommand(sb1Command);
+ List<String> param = new ArrayList<String>();
+
+ ScratchboxTarget target = null;
+ try {
+ showTargetCommand.performCommand(param);
+ fail("Number of args is invalid");
+ } catch (ESboxException e) {
+ // expected
+ }
+ param.add(theTarget);
+
+ target = (ScratchboxTarget) showTargetCommand.performCommand(param);
+
+ assertEquals(theTarget, target.getName());
+// assertTrue(ScratchboxFacade.getInstance().getCompilers(sb1Sdk).contains(
+// target.getCompiler()));
+ assertTrue(sb1Sdk.getCompilers().contains(
+ target.getCompiler()));
+// assertTrue(ScratchboxFacade.getInstance().getCputransp(sb1Sdk).contains(
+// target.getCputransp()));
+ assertTrue(sb1Sdk.getCputransp().contains(
+ target.getCputransp()));
+
+// List<String> devkitsInstalled = ScratchboxFacade.getInstance().getDevkits(sb1Sdk);
+
+ List<String> devkitsInstalled = ((Scratchbox1SDK)sb1Sdk).getDevkits();
+
+ List<String> devkitsActual = target.getDevkits();
+ for (String devkit : devkitsActual) {
+ assertTrue(devkitsInstalled.contains(devkit));
+ }
+
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestSimpleCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestSimpleCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestSimpleCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.tests.commands;
+
+import org.junit.Test;
+import org.maemo.esbox.internal.api.scratchbox.core.commands.SimpleCommand;
+import org.maemo.mica.common.core.ESboxException;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *
+ */
+public class TestSimpleCommand extends BaseTest {
+
+ /**
+ * Test method for {@link org.maemo.esbox.internal.api.scratchbox.core.commands.common.core.command.scratchbox.SimpleCommand#performCommand(java.util.List)}.
+ * @throws ESboxException
+ */
+ @Test
+ public void testPerformCommand() throws ESboxException {
+// String currentTarget = ScratchboxFacade.getInstance().getCurrentTarget(sb1Sdk);
+ String currentTarget = sb1Sdk.getCurrentTarget();
+
+ SimpleCommand simpleCommand = new SimpleCommand(sb1Command);
+ List<String> params = new ArrayList<String>();
+
+ List<String> stdoutLines = null;
+ try {
+ simpleCommand.performCommand(params);
+ fail("Invalid number of params");
+ } catch (ESboxException e) {
+
+ }
+ params.add("sb-conf");
+ params.add("current");
+
+ stdoutLines = simpleCommand.performCommand(params);
+ assertEquals(currentTarget, stdoutLines.get(0));
+ }
+
+}
Property changes on: branches/micaSplit/org.maemo.esbox.product
___________________________________________________________________
Name: svn:ignore
+ bin
Added: branches/micaSplit/org.maemo.esbox.product/.classpath
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/.classpath (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/.classpath 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: branches/micaSplit/org.maemo.esbox.product/.project
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/.project (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/.project 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.maemo.esbox.product</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: branches/micaSplit/org.maemo.esbox.product/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/.settings/org.eclipse.jdt.core.prefs 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,7 @@
+#Fri Oct 17 08:40:12 CDT 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: branches/micaSplit/org.maemo.esbox.product/ESbox.product
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/ESbox.product (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/ESbox.product 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.4"?>
+
+<product name="ESbox" id="org.maemo.esbox.product.esbox" application="org.eclipse.ui.ide.workbench" version="2.0.0.qualifier" useFeatures="true">
+
+ <aboutInfo>
+ <image path="/org.maemo.esbox.product/icons/esbox_64.png"/>
+ <text>
+ %productBlurb
+ </text>
+ </aboutInfo>
+
+ <configIni use="default">
+ </configIni>
+
+ <launcherArgs>
+ <vmArgs>-Xms40m
+-Xmx800m
+-XX:MaxPermSize=128m</vmArgs>
+ <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
+ </launcherArgs>
+
+ <windowImages i16="/org.maemo.esbox.product/icons/maemo_16x16.png" i32="/org.maemo.esbox.product/icons/esbox_32.png" i48="/org.maemo.esbox.product/icons/esbox_48.png" i64="/org.maemo.esbox.product/icons/esbox_64.png" i128="/org.maemo.esbox.product/icons/esbox_64.png"/>
+
+ <splash
+ location="org.maemo.esbox.product"
+ startupProgressRect="0,145,780,15"
+ startupMessageRect="2,125,180,15"
+ startupForegroundColor="FFFFFF" />
+ <launcher name="esbox">
+ <solaris/>
+ <win useIco="false">
+ <bmp/>
+ </win>
+ </launcher>
+
+ <intro introId="org.maemo.esbox.product.intro"/>
+
+ <vm>
+ </vm>
+
+ <plugins>
+ <plugin id="com.ibm.icu"/>
+ <plugin id="com.jcraft.jsch"/>
+ <plugin id="com.redhat.eclipse.cdt.autotools"/>
+ <plugin id="org.eclipse.cdt.core"/>
+ <plugin id="org.eclipse.cdt.core.aix"/>
+ <plugin id="org.eclipse.cdt.core.linux"/>
+ <plugin id="org.eclipse.cdt.core.linux.ia64"/>
+ <plugin id="org.eclipse.cdt.core.linux.ppc"/>
+ <plugin id="org.eclipse.cdt.core.linux.x86"/>
+ <plugin id="org.eclipse.cdt.core.linux.x86_64"/>
+ <plugin id="org.eclipse.cdt.core.macosx"/>
+ <plugin id="org.eclipse.cdt.core.qnx"/>
+ <plugin id="org.eclipse.cdt.core.solaris"/>
+ <plugin id="org.eclipse.cdt.core.win32" fragment="true"/>
+ <plugin id="org.eclipse.cdt.debug.core"/>
+ <plugin id="org.eclipse.cdt.debug.mi.core"/>
+ <plugin id="org.eclipse.cdt.debug.mi.ui"/>
+ <plugin id="org.eclipse.cdt.debug.ui"/>
+ <plugin id="org.eclipse.cdt.launch"/>
+ <plugin id="org.eclipse.cdt.make.core"/>
+ <plugin id="org.eclipse.cdt.make.ui"/>
+ <plugin id="org.eclipse.cdt.managedbuilder.core"/>
+ <plugin id="org.eclipse.cdt.managedbuilder.gnu.ui"/>
+ <plugin id="org.eclipse.cdt.managedbuilder.ui"/>
+ <plugin id="org.eclipse.cdt.ui"/>
+ <plugin id="org.eclipse.compare"/>
+ <plugin id="org.eclipse.core.commands"/>
+ <plugin id="org.eclipse.core.contenttype"/>
+ <plugin id="org.eclipse.core.databinding"/>
+ <plugin id="org.eclipse.core.expressions"/>
+ <plugin id="org.eclipse.core.filebuffers"/>
+ <plugin id="org.eclipse.core.filesystem"/>
+ <plugin id="org.eclipse.core.filesystem.linux.x86"/>
+ <plugin id="org.eclipse.core.jobs"/>
+ <plugin id="org.eclipse.core.net"/>
+ <plugin id="org.eclipse.core.net.linux.x86"/>
+ <plugin id="org.eclipse.core.resources"/>
+ <plugin id="org.eclipse.core.resources.compatibility" fragment="true"/>
+ <plugin id="org.eclipse.core.runtime"/>
+ <plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/>
+ <plugin id="org.eclipse.core.variables"/>
+ <plugin id="org.eclipse.dd.dsf"/>
+ <plugin id="org.eclipse.dd.dsf.debug"/>
+ <plugin id="org.eclipse.dd.dsf.debug.ui"/>
+ <plugin id="org.eclipse.dd.dsf.ui"/>
+ <plugin id="org.eclipse.dd.gdb"/>
+ <plugin id="org.eclipse.dd.gdb.ui"/>
+ <plugin id="org.eclipse.dd.mi"/>
+ <plugin id="org.eclipse.debug.core"/>
+ <plugin id="org.eclipse.debug.ui"/>
+ <plugin id="org.eclipse.equinox.app"/>
+ <plugin id="org.eclipse.equinox.common"/>
+ <plugin id="org.eclipse.equinox.preferences"/>
+ <plugin id="org.eclipse.equinox.registry"/>
+ <plugin id="org.eclipse.equinox.security"/>
+ <plugin id="org.eclipse.help"/>
+ <plugin id="org.eclipse.jface"/>
+ <plugin id="org.eclipse.jface.databinding"/>
+ <plugin id="org.eclipse.jface.text"/>
+ <plugin id="org.eclipse.jsch.core"/>
+ <plugin id="org.eclipse.ltk.core.refactoring"/>
+ <plugin id="org.eclipse.ltk.ui.refactoring"/>
+ <plugin id="org.eclipse.osgi"/>
+ <plugin id="org.eclipse.search"/>
+ <plugin id="org.eclipse.swt"/>
+ <plugin id="org.eclipse.swt.gtk.linux.x86"/>
+ <plugin id="org.eclipse.team.core"/>
+ <plugin id="org.eclipse.team.ui"/>
+ <plugin id="org.eclipse.text"/>
+ <plugin id="org.eclipse.ui"/>
+ <plugin id="org.eclipse.ui.browser"/>
+ <plugin id="org.eclipse.ui.console"/>
+ <plugin id="org.eclipse.ui.editors"/>
+ <plugin id="org.eclipse.ui.forms"/>
+ <plugin id="org.eclipse.ui.ide"/>
+ <plugin id="org.eclipse.ui.ide.application"/>
+ <plugin id="org.eclipse.ui.intro"/>
+ <plugin id="org.eclipse.ui.navigator"/>
+ <plugin id="org.eclipse.ui.navigator.resources"/>
+ <plugin id="org.eclipse.ui.net"/>
+ <plugin id="org.eclipse.ui.views"/>
+ <plugin id="org.eclipse.ui.views.properties.tabbed"/>
+ <plugin id="org.eclipse.ui.workbench"/>
+ <plugin id="org.eclipse.ui.workbench.texteditor"/>
+ <plugin id="org.eclipse.update.configurator"/>
+ <plugin id="org.eclipse.update.core"/>
+ <plugin id="org.eclipse.update.core.linux"/>
+ <plugin id="org.indt.esbox.core"/>
+ <plugin id="org.indt.esbox.debug"/>
+ <plugin id="org.indt.esbox.help"/>
+ <plugin id="org.indt.esbox.launch"/>
+ <plugin id="org.indt.esbox.python.debug"/>
+ <plugin id="org.indt.esbox.python.launch"/>
+ <plugin id="org.indt.esbox.python.ui"/>
+ <plugin id="org.indt.esbox.ui"/>
+ <plugin id="org.maemo.esbox.debug.dsf.gdb"/>
+ <plugin id="org.maemo.esbox.product"/>
+ <plugin id="org.maemo.esbox.project.core"/>
+ <plugin id="org.maemo.esbox.project.ui"/>
+ <plugin id="org.python.pydev"/>
+ <plugin id="org.python.pydev.ast"/>
+ <plugin id="org.python.pydev.core"/>
+ <plugin id="org.python.pydev.debug"/>
+ <plugin id="org.python.pydev.jython"/>
+ <plugin id="org.python.pydev.parser"/>
+ </plugins>
+
+ <features>
+ <feature id="org.maemo.esbox.product_feature" version="0.0.0"/>
+ <feature id="org.maemo.esbox.product.supplement_feature" version="0.0.0"/>
+ <feature id="com.redhat.eclipse.cdt.autotools.feature" version="0.0.0"/>
+ <feature id="org.eclipse.dd.dsf.gdb" version="0.0.0"/>
+ <feature id="org.eclipse.dd.dsf.gdb_launch" version="0.0.0"/>
+ <feature id="org.python.pydev.feature" version="0.0.0"/>
+ <feature id="org.eclipse.dd.dsf.sdk" version="0.0.0"/>
+ <feature id="org.eclipse.platform" version="0.0.0"/>
+ <feature id="org.eclipse.cdt" version="0.0.0"/>
+ <feature id="org.eclipse.rse" version="0.0.0"/>
+ </features>
+
+</product>
Added: branches/micaSplit/org.maemo.esbox.product/META-INF/MANIFEST.MF
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/META-INF/MANIFEST.MF (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/META-INF/MANIFEST.MF 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ESbox Product
+Bundle-SymbolicName: org.maemo.esbox.product;singleton:=true
+Bundle-Version: 2.0.0.qualifier
+Bundle-Activator: org.maemo.esbox.product.Activator
+Bundle-Vendor: INdT / Nokia
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
Added: branches/micaSplit/org.maemo.esbox.product/about.ini
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/about.ini (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/about.ini 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,29 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%productBlurb
+
+# Property "windowImage" contains path to window icon (16x16)
+# needed for primary features only
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=icons/esbox_32.png
+
+# Property "aboutImage" contains path to product image (500x330 or 115x164)
+# needed for primary features only
+# aboutImage=icons/about.png
+
+# Property "appName" contains name of the application (translated)
+# needed for primary features only
+
+# Property "welcomePerspective" contains the id of the perspective in which the
+# welcome page is to be opened.
+# optional
+
+# Link to tips and tricks help page
+# optional
+tipsAndTricksHref=/org.indt.esbox.help/html/tips.htm
Added: branches/micaSplit/org.maemo.esbox.product/about.mappings
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/about.mappings (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/about.mappings 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,9 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
+# The following should contain the build version.
+# e.g. "0=20020612"
+# This value will be added automaticaly via the build scripts
+0=200808202228
\ No newline at end of file
Added: branches/micaSplit/org.maemo.esbox.product/about.properties
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/about.properties (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/about.properties 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,11 @@
+# about.properties
+# contains externalized strings for about.ini
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# fill-ins are supplied by about.mappings
+# This file should be translated.
+
+productBlurb=Copyright (c)2007-2008 INDT, (c)2008 Nokia Corporation. All rights reserved.\n\
+Visit http://esbox.garage.maemo.org/\n\
+\n\
+This product includes software developed by Eclipse Project\n\
+Visit http://www.eclipse.org/
\ No newline at end of file
Added: branches/micaSplit/org.maemo.esbox.product/build.properties
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/build.properties (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/build.properties 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,14 @@
+bin.includes = META-INF/,\
+ plugin.xml,\
+ icons/,\
+ intro/,\
+ splash.bmp,\
+ plugin_customization.ini,\
+ about.properties,\
+ about.ini,\
+ about.mappings,\
+ plugin.properties,\
+ intro-esbox.png,\
+ introData.xml,\
+ .
+source.. = src/
Added: branches/micaSplit/org.maemo.esbox.product/icons/esboxIntroPage.gif
===================================================================
(Binary files differ)
Property changes on: branches/micaSplit/org.maemo.esbox.product/icons/esboxIntroPage.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/micaSplit/org.maemo.esbox.product/icons/esboxIntroPage_hov.gif
===================================================================
(Binary files differ)
Property changes on: branches/micaSplit/org.maemo.esbox.product/icons/esboxIntroPage_hov.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/micaSplit/org.maemo.esbox.product/icons/esbox_32.png
===================================================================
(Binary files differ)
Property changes on: branches/micaSplit/org.maemo.esbox.product/icons/esbox_32.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/micaSplit/org.maemo.esbox.product/icons/esbox_48.gif
===================================================================
(Binary files differ)
Property changes on: branches/micaSplit/org.maemo.esbox.product/icons/esbox_48.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/micaSplit/org.maemo.esbox.product/icons/esbox_48.png
===================================================================
(Binary files differ)
Property changes on: branches/micaSplit/org.maemo.esbox.product/icons/esbox_48.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/micaSplit/org.maemo.esbox.product/icons/esbox_64.png
===================================================================
(Binary files differ)
Property changes on: branches/micaSplit/org.maemo.esbox.product/icons/esbox_64.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/micaSplit/org.maemo.esbox.product/icons/maemo_16x16.png
===================================================================
(Binary files differ)
Property changes on: branches/micaSplit/org.maemo.esbox.product/icons/maemo_16x16.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/micaSplit/org.maemo.esbox.product/intro/css/overview.css
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/intro/css/overview.css (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/intro/css/overview.css 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,2 @@
+a#esboxOverview img { background-image : url('../../icons/esboxIntroPage.gif'); }
+a#esboxOverview:hover img { background-image : url('../../icons/esboxIntroPage_hov.gif'); }
Added: branches/micaSplit/org.maemo.esbox.product/intro/css/overview.properties
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/intro/css/overview.properties (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/intro/css/overview.properties 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,14 @@
+###############################################################################
+# Copyright (c) 2005, 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+overview.page-content.overview-links.layout.vspacing = 35
+
+overview.subtitle-id = overview/page-content/page-title
+overview.description-id = overview/page-content/page-description
\ No newline at end of file
Added: branches/micaSplit/org.maemo.esbox.product/intro/css/tutorials.css
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/intro/css/tutorials.css (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/intro/css/tutorials.css 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,2 @@
+a#esboxTutorial img { background-image : url('../../icons/esboxIntroPage.gif'); }
+a#esboxTutorial:hover img { background-image : url('../../icons/esboxIntroPage_hov.gif'); }
Added: branches/micaSplit/org.maemo.esbox.product/intro/css/tutorials.properties
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/intro/css/tutorials.properties (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/intro/css/tutorials.properties 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,19 @@
+###############################################################################
+# Copyright (c) 2006, 2008 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+
+tutorials.cvs_checkout.link-icon = images/topiclabel/tu_checkout48.gif
+tutorials.cvs_checkout.hover-icon = images/topiclabel/tu_checkout48_hov.gif
+
+tutorials.cvs_merge.link-icon = images/topiclabel/tu_merge48.gif
+tutorials.cvs_merge.hover-icon = images/topiclabel/tu_merge48_hov.gif
+
+tutorials.subtitle-id = tutorials/page-content/page-title
+tutorials.description-id = tutorials/page-content/page-description
Added: branches/micaSplit/org.maemo.esbox.product/intro/css/whatsnew.css
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/intro/css/whatsnew.css (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/intro/css/whatsnew.css 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,50 @@
+
+a#platform-noteworthy img { background-image : url(../../images/topiclabel/wn_eclplatform48.gif); }
+a#platform-noteworthy:hover img { background-image : url(../../images/topiclabel/wn_eclplatform48_hov.gif); }
+
+a#updates img { background-image : url(../../images/topiclabel/wn_updates48.gif); }
+a#updates:hover img { background-image : url(../../images/topiclabel/wn_updates48_hov.gif); }
+
+a#eclipse img { background-image : url(../../images/topiclabel/wn_eclcommunity48.gif); }
+a#eclipse:hover img { background-image : url(../../images/topiclabel/wn_eclcommunity48_hov.gif); }
+
+a#migration img { background-image : url(../../images/topiclabel/wn_migrate48.gif); }
+a#migration:hover img { background-image : url(../../images/topiclabel/wn_migrate48_hov.gif); }
+
+div#rss-news {
+ position: relative;
+ top: -25px;
+ margin-bottom: -25px;
+ margin-left: 52px;
+}
+
+#rss-news .div-label {
+ font-size: 9pt;
+}
+
+#rss-news .provided-content {
+}
+
+#rss-news .status-text {
+ font-weight: normal;
+ color: #909090;
+ font-size: 8pt;
+}
+
+ul#eclipse-news {
+ list-style-type: none;
+ list-style-image: url("../../images/topiclabel/arrow.gif");
+ margin-left: 10px;
+ margin-top: 5px;
+}
+
+ul#eclipse-news li {
+}
+
+ul#eclipse-news a {
+ font-weight: normal;
+}
+
+ul#eclipse-news a:hover {
+ text-decoration: underline;
+}
\ No newline at end of file
Added: branches/micaSplit/org.maemo.esbox.product/intro/css/whatsnew.properties
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/intro/css/whatsnew.properties (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/intro/css/whatsnew.properties 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,26 @@
+###############################################################################
+# Copyright (c) 2005, 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+
+whatsnew.platform-noteworthy.link-icon = images/topiclabel/wn_eclplatform48.gif
+whatsnew.platform-noteworthy.hover-icon = images/topiclabel/wn_eclplatform48_hov.gif
+
+whatsnew.updates.link-icon = images/topiclabel/wn_updates48.gif
+whatsnew.updates.hover-icon = images/topiclabel/wn_updates48_hov.gif
+
+whatsnew.eclipse.link-icon = images/topiclabel/wn_eclcommunity48.gif
+whatsnew.eclipse.hover-icon = images/topiclabel/wn_eclcommunity48_hov.gif
+
+whatsnew.migration.link-icon = images/topiclabel/wn_migrate48.gif
+whatsnew.migration.hover-icon = images/topiclabel/wn_migrate48_hov.gif
+
+whatsnew.page-content.layout.vspacing = 40
+
+whatsnew.subtitle-id = news/page-content/page-title
Added: branches/micaSplit/org.maemo.esbox.product/intro/overviewExtensionContent.xml
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/intro/overviewExtensionContent.xml (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/intro/overviewExtensionContent.xml 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<introContent>
+ <extensionContent id="org.maemo.org.product.intro.overviewExtension" style="css/overview.css"
+ name="ESbox Overview" path="overview/@">
+ <group style-id="content-group" id="org.maemo.org.product.intro.overviewGroup">
+ <link label="ESbox Development"
+ url="http://org.eclipse.ui.intro/showHelpTopic?id=/org.maemo.esbox.help/html/toc.html"
+ id="esboxOverview"
+ style-id="content-link">
+ <text>Get to know what is ESbox and how it can help with your Maemo application development.</text>
+ </link>
+ </group>
+ </extensionContent>
+</introContent>
\ No newline at end of file
Added: branches/micaSplit/org.maemo.esbox.product/intro/tutorialsExtensionContent.xml
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/intro/tutorialsExtensionContent.xml (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/intro/tutorialsExtensionContent.xml 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<introContent>
+ <!-- Extension to the SDK Tutorials Page. -->
+ <extensionContent
+ id="org.maemo.org.product.intro.tutorialExtension"
+ name="ESbox Tutorial"
+ alt-style="css/tutorials.properties"
+ style="css/tutorials.css"
+ path="tutorials/@">
+ <group id="esboxTutorial" style-id="content-group">
+ <link label="ESbox Development"
+ url="http://org.eclipse.ui.intro/showHelpTopic?id=/org.maemo.esbox.help/html/gettingstarted/BasicTutorial.html"
+ id="esboxTutorial"
+ style-id="content-link">
+ <text>Learn how to create ESbox projects</text>
+ </link>
+ </group>
+ </extensionContent>
+</introContent>
Added: branches/micaSplit/org.maemo.esbox.product/intro-esbox.png
===================================================================
(Binary files differ)
Property changes on: branches/micaSplit/org.maemo.esbox.product/intro-esbox.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/micaSplit/org.maemo.esbox.product/introData.xml
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/introData.xml (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/introData.xml 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<extensions>
+ <page id="tutorials">
+ <group path="page-content/bottom-left" default="true">
+ <extension id="orgeclipsecdtdocuserwelcome-introExtension" importance="low"/>
+ </group>
+ <group path="page-content/bottom-right" default="true">
+ </group>
+ <group path="page-content/top-left">
+ <extension id="org.maemo.org.product.intro.tutorialExtension" importance="new"/>
+ </group>
+ <group path="page-content/top-right">
+ </group>
+ <hidden> <extension id="org.eclipse.jdt" importance="low"/>
+ <extension id="org.eclipse.team" importance="low"/>
+ <extension id="org.eclipse.pde" importance="low"/>
+ </hidden>
+ </page>
+ <page id="samples">
+ <group path="page-content/bottom-left" default="true">
+ </group>
+ <group path="page-content/bottom-right" default="true">
+ </group>
+ <group path="page-content/top-left">
+ <extension id="org.eclipse.pde.workbench" importance="low"/>
+ </group>
+ <group path="page-content/top-right">
+ <extension id="org.eclipse.jdt" importance="low"/>
+ <extension id="org.eclipse.pde.swt" importance="low"/>
+ </group>
+ </page>
+ <page id="whatsnew">
+ <group path="page-content/bottom-left" default="true">
+ <extension id="orgeclipsecdtdocuserwelcome-introExtension" importance="low"/>
+ </group>
+ <group path="page-content/bottom-right" default="true">
+ </group>
+ <group path="page-content/top-left">
+ <extension id="org.eclipse.ui.workbench.news" importance="low"/>
+ <extension id="org.eclipse.jdt" importance="low"/>
+ <extension id="org.eclipse.pde.changes" importance="low"/>
+ <extension id="org.eclipse.ui.workbench.migration" importance="callout"/>
+ </group>
+ <group path="page-content/top-right">
+ <extension id="org.eclipse.ui.workbench" importance="low"/>
+ </group>
+ </page>
+ <page id="overview">
+ <group path="page-content/bottom-left" default="true">
+ <extension id="orgeclipsecdtdocuserwelcome-introExtension" importance="low"/>
+ </group>
+ <group path="page-content/bottom-right" default="true">
+ </group>
+ <group path="page-content/top-left">
+ <extension id="org.maemo.org.product.intro.overviewExtension" importance="new"/>
+ </group>
+ <group path="page-content/top-right">
+ </group>
+ <hidden> <extension id="org.eclipse.ui.workbench" importance="low"/>
+ <extension id="org.eclipse.jdt" importance="low"/>
+ <extension id="org.eclipse.pde" importance="low"/>
+ </hidden>
+ </page>
+</extensions>
Added: branches/micaSplit/org.maemo.esbox.product/plugin.properties
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/plugin.properties (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/plugin.properties 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,34 @@
+###############################################################################
+# Copyright (c) 2008 Nokia.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Ling Wang (Nokia) - initial implementation
+###############################################################################
+pluginName=ESbox Product Plugin
+providerName=INDT & Nokia
+
+productName=ESbox
+productBlurb=ESbox\n\
+version: 2.0.0\n\
+Build id: {0}\n\
+\n\
+Copyright (c)2007-2008 INDT, 2008 Nokia Corporation. All rights reserved.\n\
+Visit http://esbox.garage.maemo.org/\n\
+This product includes software developed by Eclipse Project.\n\
+Visit http://www.eclipse.org/
+
+cheatsheet.actionset = Cheat Sheets
+cheatsheet.item = &Cheat Sheets...
+shortcut.overview.tooltip = Overview
+shortcut.tutorials.tooltip = Tutorials
+shortcut.samples.tooltip = Samples
+shortcut.whatsnew.tooltip = What's New
+
+productIntroTitle = Welcome to ESbox 2.0.0
+productIntroBrandingText = ESbox
+introDescription-overview = ESbox is an Eclipse plug-in that helps programmers to develop applications for maemo platform on Scratchbox Apophis.
+introDescription-tutorials = Learn how to be productive using ESbox by completing end-to-end tutorials that will guide you along the way.
Added: branches/micaSplit/org.maemo.esbox.product/plugin.xml
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/plugin.xml (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/plugin.xml 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,239 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ id="esbox"
+ name="ESbox"
+ point="org.eclipse.core.runtime.products">
+ <product
+ application="org.eclipse.ui.ide.workbench"
+ description="Eclipse development environment for Maemo application developers"
+ name="ESbox">
+ <property
+ name="windowImages"
+ value="icons/maemo_16x16.png,icons/esbox_32.png,icons/esbox_48.png,icons/esbox_64.png,icons/esbox_64.png">
+ </property>
+ <property
+ name="aboutText"
+ value="%productBlurb">
+ </property>
+ <property
+ name="aboutImage"
+ value="icons/esbox_64.png">
+ </property>
+ <property
+ name="startupProgressRect"
+ value="0,145,780,15">
+ </property>
+ <property
+ name="preferenceCustomization"
+ value="plugin_customization.ini">
+ </property>
+ <property
+ name="appName"
+ value="ESbox">
+ </property>
+ <property
+ name="startupForegroundColor"
+ value="FFFFFF">
+ </property>
+ <property
+ name="startupMessageRect"
+ value="2,125,180,15">
+ </property>
+ <property
+ name="introTitle"
+ value="%productIntroTitle"/>
+ <property
+ name="introBrandingImage"
+ value="product:intro-esbox.png"/>
+ <property
+ name="introBrandingImageText"
+ value="%productIntroBrandingText"/>
+ <property
+ name="introDescription-overview"
+ value="%introDescription-overview"/>
+ <property
+ name="introDescription-tutorials"
+ value="%introDescription-tutorials"/>
+ <property
+ name="introDescription-samples"
+ value="%introDescription-samples"/>
+ </product>
+ </extension>
+ <extension
+ point="org.eclipse.ui.intro">
+ <introProductBinding
+ introId="org.eclipse.ui.intro.universal"
+ productId="org.maemo.esbox.product.esbox">
+ </introProductBinding>
+ </extension>
+
+ <!-- ===================================================== -->
+ <!-- Standby Content Part contributions -->
+ <!-- ===================================================== -->
+ <extension point="org.eclipse.ui.intro.configExtension">
+ <configExtension
+ configId="org.eclipse.ui.intro.universalConfig"
+ content="$nl$/intro/overviewExtensionContent.xml"/>
+ <configExtension
+ configId="org.eclipse.ui.intro.universalConfig"
+ content="$nl$/intro/tutorialsExtensionContent.xml"/>
+ </extension>
+
+<!-- show global Welcome preference page. Not really needed.
+
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.eclipse.ui.preferencePages.Workbench"
+ class="org.eclipse.ui.internal.intro.universal.WelcomeCustomizationPreferencePage"
+ id="org.maemo.esbox.product.introCustomization"
+ name="ESbox Welcome">
+ </page>
+ </extension>
+-->
+
+ <!-- ===================================================== -->
+ <!-- Hide unwanted UI elements -->
+ <!-- ===================================================== -->
+
+ <extension
+ point="org.eclipse.ui.activities">
+
+ <category
+ name="Hidden by ESbox"
+ description="Access the features of other plugins which are not relevant to ESbox development. You can choose to turn on them when needed."
+ id="org.maemo.esbox.toolsCategory">
+ </category>
+
+ <!-- ********* CDT ********************* -->
+ <activity
+ name="CDT Elements"
+ description="UI elements from CDT which are not applicable to ESbox C/C++ development. Enable this capability if you want to use them."
+ id="org.maemo.esbox.product.cdtActivity">
+ </activity>
+
+ <categoryActivityBinding
+ activityId="org.maemo.esbox.product.cdtActivity"
+ categoryId="org.maemo.esbox.toolsCategory">
+ </categoryActivityBinding>
+
+ <activityPatternBinding
+ activityId="org.maemo.esbox.product.cdtActivity"
+ pattern="org.eclipse.cdt.launch/org.eclipse.cdt.launch.*CLaunch">
+ </activityPatternBinding>
+
+ <activityPatternBinding
+ activityId="org.maemo.esbox.product.cdtActivity"
+ pattern="org.eclipse.cdt.launch/org.eclipse.cdt.debug.ui.*CShortcut">
+ </activityPatternBinding>
+
+ <activityPatternBinding
+ activityId="org.maemo.esbox.product.cdtActivity"
+ pattern="org.eclipse.cdt.ui/org.eclipse.cdt.ui.wizards.*">
+ </activityPatternBinding>
+
+<!-- I cannot find a way to hide the "New->C Project" menu command in context menu of Project View
+ And these don't help...... LWang. 08/28/08
+
+ <activityPatternBinding
+ activityId="org.maemo.esbox.product.cdtActivity"
+ pattern="org.eclipse.cdt.ui/org.eclipse.cdt.ui.actions.New*DropDown">
+ </activityPatternBinding>
+ <activityPatternBinding
+ activityId="org.maemo.esbox.product.cdtActivity"
+ pattern="org.eclipse.cdt.ui/org.eclipse.cdt.ui.*Wizards">
+ </activityPatternBinding>
+-->
+
+ <!-- The "Convert to C/C++ Make Project" menu command. -->
+ <activityPatternBinding
+ activityId="org.maemo.esbox.product.cdtActivity"
+ pattern="org.eclipse.cdt.managedbuilder.ui/org.eclipse.cdt.ui.wizards.*Wizard">
+ </activityPatternBinding>
+
+ <!-- "Shared Defaults" template page; we don't use CDT's template engine anymore -->
+ <activityPatternBinding
+ activityId="org.maemo.esbox.product.cdtActivity"
+ pattern="org.eclipse.cdt.ui/org.eclipse.cdt.core.templateengine.shareddefaults">
+ </activityPatternBinding>
+
+ <!-- managed builder pages -->
+ <activityPatternBinding
+ activityId="org.maemo.esbox.product.cdtActivity"
+ pattern="org.eclipse.cdt.managedbuilder.ui/org.eclipse.cdt.managedbuilder.ui.preferences.*">
+ </activityPatternBinding>
+
+ <!-- ********* DSF ********************* -->
+ <activity
+ name="DD-DSF"
+ description="UI elements from DD-DSF. Enable this capability to uncover them."
+ id="org.maemo.esbox.product.dsfActivity">
+ </activity>
+
+ <categoryActivityBinding
+ activityId="org.maemo.esbox.product.dsfActivity"
+ categoryId="org.maemo.esbox.toolsCategory">
+ </categoryActivityBinding>
+
+ <activityPatternBinding
+ activityId="org.maemo.esbox.product.dsfActivity"
+ pattern="org.eclipse.dd.gdb.launch/org.eclipse.dd.gdb.launch.*CLaunch">
+ </activityPatternBinding>
+
+ <!-- ********* Redhat Autotools ********************* -->
+ <activity
+ name="Autotools Elements"
+ description="UI elements from Redhat Autotools project. Enable this capability to uncover them."
+ id="org.maemo.esbox.product.autotoolsActivity">
+ </activity>
+
+ <categoryActivityBinding
+ activityId="org.maemo.esbox.product.autotoolsActivity"
+ categoryId="org.maemo.esbox.toolsCategory">
+ </categoryActivityBinding>
+
+ <activityPatternBinding
+ activityId="org.maemo.esbox.product.autotoolsActivity"
+ pattern="com.redhat.eclipse.cdt.autotools/com.redhat.eclipse.cdt.autotools.wizard1">
+ </activityPatternBinding>
+ <activityPatternBinding
+ activityId="org.maemo.esbox.product.autotoolsActivity"
+ pattern="com.redhat.eclipse.cdt.autotools/com.redhat.eclipse.cdt.autotools.wizard2">
+ </activityPatternBinding>
+ <activityPatternBinding
+ activityId="org.maemo.esbox.product.autotoolsActivity"
+ pattern="com.redhat.eclipse.cdt.autotools/com.redhat.eclipse.cdt.autotools.wizard3">
+ </activityPatternBinding>
+
+
+ <!--************ Pydev elements *********-->
+
+ <activity
+ name="Pydev Elements"
+ description="UI elements from Pydev. Enable this capability to uncover them."
+ id="org.maemo.esbox.product.pydevActivity">
+ </activity>
+
+ <categoryActivityBinding
+ activityId="org.maemo.esbox.product.pydevActivity"
+ categoryId="org.maemo.esbox.toolsCategory">
+ </categoryActivityBinding>
+
+ <activityPatternBinding
+ activityId="org.maemo.esbox.product.pydevActivity"
+ pattern="org.python.pydev.debug/org.python.pydev.debug.*LaunchConfigurationType">
+ </activityPatternBinding>
+ <activityPatternBinding
+ activityId="org.maemo.esbox.product.pydevActivity"
+ pattern="org.python.pydev.debug/org.python.pydev.debug.ui.launchShortcut.*">
+ </activityPatternBinding>
+ <activityPatternBinding
+ activityId="org.maemo.esbox.product.pydevActivity"
+ pattern="org.python.pydev/org.python.pydev.ui.wizards.project.*">
+ </activityPatternBinding>
+
+ </extension>
+
+</plugin>
Added: branches/micaSplit/org.maemo.esbox.product/plugin_customization.ini
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/plugin_customization.ini (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/plugin_customization.ini 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,31 @@
+# plugin_customization.ini
+# sets default values for plug-in-specific preferences
+# keys are qualified by plug-in id
+# e.g., com.example.acmeplugin/myproperty=myvalue
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in plugin_customization.properties
+# This file does not need to be translated.
+
+# Property "org.eclipse.ui/defaultPerspectiveId" controls the
+# perspective that the workbench opens initially
+org.eclipse.ui/defaultPerspectiveId=org.eclipse.cdt.ui.CPerspective
+
+# new-style tabs by default
+org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
+
+# put the perspective switcher on the top right
+org.eclipse.ui/DOCK_PERSPECTIVE_BAR=topRight
+
+# show progress on startup
+org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP=true
+
+# Welcome theme to use
+# org.eclipse.ui.intro/INTRO_THEME = org.eclipse.ui.intro.universal.circles
+org.eclipse.ui.intro/INTRO_THEME = org.eclipse.ui.intro.universal.purpleMesh
+
+# Root page links to show in the Universal Welcome
+# org.eclipse.ui.intro.universal/INTRO_ROOT_PAGES = overview,tutorials,samples,whatsnew
+org.eclipse.ui.intro.universal/INTRO_ROOT_PAGES = overview,tutorials
+
+# Initial page layout of the Universal Welcome
+org.eclipse.ui.intro.universal/INTRO_DATA = product:introData.xml
Added: branches/micaSplit/org.maemo.esbox.product/splash.bmp
===================================================================
(Binary files differ)
Property changes on: branches/micaSplit/org.maemo.esbox.product/splash.bmp
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/micaSplit/org.maemo.esbox.product/src/org/maemo/esbox/product/Activator.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.product/src/org/maemo/esbox/product/Activator.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product/src/org/maemo/esbox/product/Activator.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,50 @@
+package org.maemo.esbox.product;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.maemo.esbox.product";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Property changes on: branches/micaSplit/org.maemo.esbox.product-feature
___________________________________________________________________
Name: svn:ignore
+ bin
Added: branches/micaSplit/org.maemo.esbox.product-feature/.project
===================================================================
--- branches/micaSplit/org.maemo.esbox.product-feature/.project (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product-feature/.project 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.maemo.esbox.product-feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Added: branches/micaSplit/org.maemo.esbox.product-feature/build.properties
===================================================================
--- branches/micaSplit/org.maemo.esbox.product-feature/build.properties (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product-feature/build.properties 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,3 @@
+bin.includes = feature.xml,\
+ license.html,\
+ licenses/
Added: branches/micaSplit/org.maemo.esbox.product-feature/feature.xml
===================================================================
--- branches/micaSplit/org.maemo.esbox.product-feature/feature.xml (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product-feature/feature.xml 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.maemo.esbox.product"
+ label="ESbox Product Feature"
+ version="2.0.0.qualifier"
+ provider-name="INdT / NOKIA"
+ plugin="org.maemo.esbox.product">
+
+ <description>
+ Top-level ESbox product feature that includes all ESbox and Mica components.
+ </description>
+
+ <copyright>
+ Copyright (c) 2007-2008 INdT, (c) 2007-2008 Nokia. All rights
+reserved.
+ </copyright>
+
+ <license url="http://www.eclipse.org/legal/epl-v10.html">
+ For legal terms, see the Eclipse Public License.
+ </license>
+
+ <url>
+ <update label="Update Site for ESbox project" url="http://esbox.garage.maemo.org/update"/>
+ </url>
+
+ <includes
+ id="org.maemo.mica.common"
+ version="0.0.0"/>
+
+ <includes
+ id="org.maemo.mica.cpp"
+ version="0.0.0"/>
+
+ <includes
+ id="org.maemo.mica.protocol"
+ version="0.0.0"/>
+
+ <includes
+ id="org.maemo.mica.linux"
+ version="0.0.0"/>
+
+ <includes
+ id="org.maemo.mica.maemosdk"
+ version="0.0.0"/>
+
+ <includes
+ id="org.maemo.esbox.scratchbox"
+ version="0.0.0"/>
+
+ <includes
+ id="org.maemo.mica.python"
+ version="0.0.0"/>
+
+ <includes
+ id="org.maemo.mica.protocol.rse"
+ version="0.0.0"/>
+
+ <includes
+ id="org.maemo.esbox"
+ version="0.0.0"/>
+
+ <requires>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ </requires>
+
+ <plugin
+ id="org.maemo.esbox.product"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.maemo.esbox.help"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+</feature>
Added: branches/micaSplit/org.maemo.esbox.product-feature/license.html
===================================================================
--- branches/micaSplit/org.maemo.esbox.product-feature/license.html (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product-feature/license.html 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,22 @@
+<html>
+<head>
+<title>ESbox License</title>
+</head>
+
+<body>
+<h2>ESbox Software User Agreement</h2>
+<p>16<sup>th</sup> April, 2008</p>
+
+<h3>ESbox</h3>
+
+<p>ESbox is licensed under the terms of the <a href="licenses/epl-v10.html">Eclipse Public License v1.0</a>.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>ESbox has a set of open source templates to help the development of applications. Such templates are distributed
+under <a href="licenses/COPYING.LESSER">LGPL license.</a></p>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THIS CONTENT.</p>
+
+</body>
+</html>
Added: branches/micaSplit/org.maemo.esbox.product-feature/licenses/COPYING
===================================================================
--- branches/micaSplit/org.maemo.esbox.product-feature/licenses/COPYING (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product-feature/licenses/COPYING 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
Added: branches/micaSplit/org.maemo.esbox.product-feature/licenses/COPYING.LESSER
===================================================================
--- branches/micaSplit/org.maemo.esbox.product-feature/licenses/COPYING.LESSER (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product-feature/licenses/COPYING.LESSER 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
Added: branches/micaSplit/org.maemo.esbox.product-feature/licenses/epl-v10.html
===================================================================
--- branches/micaSplit/org.maemo.esbox.product-feature/licenses/epl-v10.html (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product-feature/licenses/epl-v10.html 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,328 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 9">
+<meta name=Originator content="Microsoft Word 9">
+<link rel=File-List
+href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
+<title>Eclipse Public License - Version 1.0</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Revision>2</o:Revision>
+ <o:TotalTime>3</o:TotalTime>
+ <o:Created>2004-03-05T23:03:00Z</o:Created>
+ <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+ <o:Pages>4</o:Pages>
+ <o:Words>1626</o:Words>
+ <o:Characters>9270</o:Characters>
+ <o:Lines>77</o:Lines>
+ <o:Paragraphs>18</o:Paragraphs>
+ <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+ <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+ at font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-generic-font-family:swiss;
+ mso-font-pitch:variable;
+ mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p
+ {margin-right:0in;
+ mso-margin-top-alt:auto;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+ font-family:Tahoma;
+ mso-fareast-font-family:"Times New Roman";}
+ at page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.25in 1.0in 1.25in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+</head>
+
+<body lang=EN-US style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>"Contribution" means:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear=left>
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+changes to the Program, and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+additions to the Program;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>"Contributor" means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style='font-size:10.0pt'>"Licensed Patents " mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>"Program" means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style='font-size:10.0pt'>"Recipient" means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span
+style='color:red'> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+its license agreement:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
+
+<p><span style='font-size:10.0pt'>When the Program is made available in source
+code form:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it must be made available under this Agreement; and </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style='font-size:10.0pt'>Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor ("Commercial
+Contributor") hereby agrees to defend and indemnify every other
+Contributor ("Indemnified Contributor") against any losses, damages and
+costs (collectively "Losses") arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style='font-size:10.0pt'>For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
+
+<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class=MsoNormal><![if !supportEmptyParas]> <![endif]><o:p></o:p></p>
+
+</div>
+
+</body>
+
+</html>
\ No newline at end of file
Property changes on: branches/micaSplit/org.maemo.esbox.product.supplement-feature
___________________________________________________________________
Name: svn:ignore
+ bin
Added: branches/micaSplit/org.maemo.esbox.product.supplement-feature/.project
===================================================================
--- branches/micaSplit/org.maemo.esbox.product.supplement-feature/.project (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product.supplement-feature/.project 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.maemo.esbox.product.supplement-feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Added: branches/micaSplit/org.maemo.esbox.product.supplement-feature/build.properties
===================================================================
--- branches/micaSplit/org.maemo.esbox.product.supplement-feature/build.properties (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product.supplement-feature/build.properties 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,4 @@
+bin.includes = feature.xml,\
+ readme.txt,\
+ licenses/,\
+ license.html
Added: branches/micaSplit/org.maemo.esbox.product.supplement-feature/feature.xml
===================================================================
--- branches/micaSplit/org.maemo.esbox.product.supplement-feature/feature.xml (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product.supplement-feature/feature.xml 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.maemo.esbox.product.supplement"
+ label="ESbox Supplement Feature"
+ version="2.0.0.qualifier"
+ provider-name="NOKIA">
+
+ <description>
+ Supplemental plugins as a subset of standard Eclipse features required by ESbox.
+ </description>
+
+ <copyright url="http://www.example.com/copyright">
+ [Enter Copyright Description here.]
+ </copyright>
+
+ <license url="http://www.example.com/license">
+ [Enter License Description here.]
+ </license>
+
+ <url>
+ <update label="Update Site for ESbox project" url="http://esbox.garage.maemo.org/update"/>
+ </url>
+
+ <plugin
+ id="org.eclipse.sdk"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.ui.views.log"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.emf.common"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.emf.ecore"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.emf.ecore.xmi"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
Added: branches/micaSplit/org.maemo.esbox.product.supplement-feature/license.html
===================================================================
--- branches/micaSplit/org.maemo.esbox.product.supplement-feature/license.html (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product.supplement-feature/license.html 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,22 @@
+<html>
+<head>
+<title>ESbox License</title>
+</head>
+
+<body>
+<h2>ESbox Software User Agreement</h2>
+<p>16<sup>th</sup> April, 2008</p>
+
+<h3>ESbox</h3>
+
+<p>ESbox is licensed under the terms of the <a href="licenses/epl-v10.html">Eclipse Public License v1.0</a>.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>ESbox has a set of open source templates to help the development of applications. Such templates are distributed
+under <a href="licenses/COPYING.LESSER">LGPL license.</a></p>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THIS CONTENT.</p>
+
+</body>
+</html>
Added: branches/micaSplit/org.maemo.esbox.product.supplement-feature/licenses/COPYING
===================================================================
--- branches/micaSplit/org.maemo.esbox.product.supplement-feature/licenses/COPYING (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product.supplement-feature/licenses/COPYING 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
Added: branches/micaSplit/org.maemo.esbox.product.supplement-feature/licenses/COPYING.LESSER
===================================================================
--- branches/micaSplit/org.maemo.esbox.product.supplement-feature/licenses/COPYING.LESSER (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product.supplement-feature/licenses/COPYING.LESSER 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
Added: branches/micaSplit/org.maemo.esbox.product.supplement-feature/licenses/epl-v10.html
===================================================================
--- branches/micaSplit/org.maemo.esbox.product.supplement-feature/licenses/epl-v10.html (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product.supplement-feature/licenses/epl-v10.html 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,328 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 9">
+<meta name=Originator content="Microsoft Word 9">
+<link rel=File-List
+href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
+<title>Eclipse Public License - Version 1.0</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Revision>2</o:Revision>
+ <o:TotalTime>3</o:TotalTime>
+ <o:Created>2004-03-05T23:03:00Z</o:Created>
+ <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+ <o:Pages>4</o:Pages>
+ <o:Words>1626</o:Words>
+ <o:Characters>9270</o:Characters>
+ <o:Lines>77</o:Lines>
+ <o:Paragraphs>18</o:Paragraphs>
+ <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+ <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+ at font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-generic-font-family:swiss;
+ mso-font-pitch:variable;
+ mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p
+ {margin-right:0in;
+ mso-margin-top-alt:auto;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+ font-family:Tahoma;
+ mso-fareast-font-family:"Times New Roman";}
+ at page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.25in 1.0in 1.25in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+</head>
+
+<body lang=EN-US style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>"Contribution" means:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear=left>
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+changes to the Program, and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+additions to the Program;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>"Contributor" means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style='font-size:10.0pt'>"Licensed Patents " mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>"Program" means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style='font-size:10.0pt'>"Recipient" means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span
+style='color:red'> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+its license agreement:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
+
+<p><span style='font-size:10.0pt'>When the Program is made available in source
+code form:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it must be made available under this Agreement; and </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style='font-size:10.0pt'>Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor ("Commercial
+Contributor") hereby agrees to defend and indemnify every other
+Contributor ("Indemnified Contributor") against any losses, damages and
+costs (collectively "Losses") arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style='font-size:10.0pt'>For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
+
+<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class=MsoNormal><![if !supportEmptyParas]> <![endif]><o:p></o:p></p>
+
+</div>
+
+</body>
+
+</html>
\ No newline at end of file
Added: branches/micaSplit/org.maemo.esbox.product.supplement-feature/readme.txt
===================================================================
--- branches/micaSplit/org.maemo.esbox.product.supplement-feature/readme.txt (rev 0)
+++ branches/micaSplit/org.maemo.esbox.product.supplement-feature/readme.txt 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,19 @@
+This feature is supposed to provide plugins from Eclipse.org or other third parties
+that are needed by ESbox product build (not feature or plugin build) but their default
+owner features contain more than what ESbox needs.
+
+For instance:
+* The "org.eclipse.sdk" plugin gives us the global "Capabilities" preference page,
+ but the "org.eclipse.sdk" _feature_ contains JDT in it, way more than what
+ ESbox needs. Refer to
+ https://bugs.eclipse.org/bugs/show_bug.cgi?id=130502
+
+* Similarly, "org.eclipse.ui.views.log" plugin gives us the "Error Log" view, but
+ its default owner feature PDE is way too big for ESbox.
+
+* Finally, we need four plugins from EMF, but do not want to bring in its 20 plugins.
+
+-- Ling Wang.
+ Nokia.
+ 09/16/08
+
\ No newline at end of file
Property changes on: branches/micaSplit/org.maemo.esbox.scratchbox.sb1
___________________________________________________________________
Name: svn:ignore
+ bin
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/.classpath
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/.classpath (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/.classpath 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/.project
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/.project (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/.project 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.maemo.esbox.scratchbox.sb1</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/META-INF/MANIFEST.MF
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/META-INF/MANIFEST.MF (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/META-INF/MANIFEST.MF 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ESbox Scratchbox 1 Support
+Bundle-SymbolicName: org.maemo.esbox.scratchbox.sb1;singleton:=true
+Bundle-Version: 2.0.0.qualifier
+Bundle-Activator: org.maemo.esbox.internal.scratchbox.sb1.Activator
+Require-Bundle: org.eclipse.core.runtime,
+ org.maemo.mica.maemosdk.core;bundle-version="2.0.0";visibility:=reexport,
+ org.eclipse.ui.ide,
+ org.maemo.mica.maemosdk.ui;bundle-version="2.0.0",
+ org.maemo.esbox.scratchbox.core;bundle-version="2.0.0",
+ org.maemo.esbox.scratchbox.ui;bundle-version="2.0.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: INdT / Nokia
+Export-Package: org.maemo.esbox.internal.scratchbox.sb1.command;x-friends:="org.maemo.esbox.scratchbox.tests",
+ org.maemo.esbox.internal.scratchbox.sb1.core;x-friends:="org.maemo.esbox.scratchbox.tests",
+ org.maemo.esbox.internal.scratchbox.sb1.provider;x-friends:="org.maemo.esbox.scratchbox.tests",
+ org.maemo.esbox.scratchbox.sb1.sdk
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/build.properties
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/build.properties (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/build.properties 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ conf/
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/conf/run.sh
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/conf/run.sh (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/conf/run.sh 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+#/*******************************************************************************
+# * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia.
+# * All rights reserved. This program and the accompanying materials
+# * are made available under the terms of the Eclipse Public License v1.0
+# * which accompanies this distribution, and is available at
+# * http://www.eclipse.org/legal/epl-v10.html
+# *
+# * Contributors:
+# * Raul Herbster (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
+# * Ed Swartz (Nokia) - additions and changes
+# *******************************************************************************/
+
+__version=0.5
+__release=1.2
+__location=$1
+__export_list=$2
+shift
+shift
+__command="$@"
+
+if [ ! -d $__location ] ; then
+ echo "E: Directory $__location not found"
+ exit 1
+fi
+
+cd $__location
+
+# apply exports and unsets
+if [ "$__export_list" != "-" ] ; then
+ IFS=,; for __export in $__export_list; do
+ case $__export in
+ -* ) unset `echo $__export | sed s/-//` ;;
+ * ) export $__export ;;
+ esac
+ done
+ IFS=" "
+fi
+
+# Run command
+$__command
+
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/conf/sb1_prefs.xml
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/conf/sb1_prefs.xml (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/conf/sb1_prefs.xml 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>This file contains the default settings for Scratchbox 1 preferences;
+ see the org.maemo.mica.common.core.preference_set_provider extension</comment>
+
+ <!-- WHEN ANY DEFAULTS CHANGED warranting rewriting prefs,
+ bump pref version in esbox_common.xml and adjust ESboxPreferenceInitializer#RPEFS_VERSION_MAJOR ;
+ WHEN ANYTHING ELSE CHANGED which can be merged into existing prefs,
+ adjust ESboxPreferenceInitializer#RPEFS_VERSION_MINOR -->
+
+ <entry key="SB1_LOGIN_COMMAND">/scratchbox/login -d ${RUN_SCRIPT_DIRECTORY} "./${RUN_SCRIPT} ${{DIRECTORY}} \\\"${{{EXPORTS}}}\\\" \\\"${{{COMMAND}}} ${{{ARGS}}}\\\""</entry>
+ <entry key="SB1_SBOX_COMMAND">sb-conf ${ACTIONS} ${OPTIONS}</entry>
+
+ <entry key="RUN_SCRIPT_LOC">/scratchbox/users/${USER}/home/${USER}/.esbox/</entry>
+
+ <!-- this uses ${QEMU} because the default qemu-arm is an often misconfigured softlink: see GetGdbQemuCommandPatternCommand -->
+ <entry key="SB1_GDB_REMOTE_QEMU">${QEMU} -g ${PORT}</entry>
+
+ <!-- actions of command sb-conf -->
+
+ <entry key="SB1_VERSION_ACT">version</entry>
+ <entry key="SB1_SETUP_ACT">setup</entry>
+ <entry key="SB1_INSTALL_ACT">install</entry>
+ <entry key="SB1_ROOTSTRAP_ACT">rootstrap</entry>
+ <entry key="SB1_SELECT_ACT">select</entry>
+ <entry key="SB1_RESET_ACT">reset</entry>
+ <entry key="SB1_KILLALL_ACT">killall</entry>
+ <entry key="SB1_REMOVE_ACT">remove</entry>
+ <entry key="SB1_SHOW_ACT">show</entry>
+ <entry key="SB1_LIST_ACT">list</entry>
+ <entry key="SB1_CURRENT_ACT">current</entry>
+
+ <!-- options for action rootstrap -->
+ <entry key="SB1_ROOTSTRAP_OPT_FORCE">--force</entry>
+ <entry key="SB1_SETUP_ACT">setup</entry>
+
+ <!-- options for action remove -->
+ <entry key="SB1_REMOVE_OPT_FORCE">--force</entry>
+
+ <!-- options for action setup -->
+ <entry key="SB1_SETUP_OPT_COMPILER">--compiler=${COMPILER}</entry>
+ <entry key="SB1_SETUP_OPT_DEVKITS">--devkits=${LIST}</entry>
+ <entry key="SB1_SETUP_OPT_CPUTRANSP">--cputransp=${METHOD}</entry>
+ <entry key="SB1_SETUP_OPT_FORCE">--force</entry>
+
+ <!-- options for action killall -->
+ <entry key="SB1_KILLALL_OPT_SIGNAL">signal=${SIGNAL}</entry>
+
+ <!-- options for action install -->
+ <entry key="SB1_INSTALL_OPT_CLIB">--clibrary</entry>
+ <entry key="SB1_INSTALL_OPT_ETC">--etc</entry>
+ <entry key="SB1_INSTALL_OPT_DEVKITS">--devkits</entry>
+ <entry key="SB1_INSTALL_OPT_FAKE">--fakeroot</entry>
+ <entry key="SB1_INSTALL_OPT_GDB">--gdb</entry>
+ <entry key="SB1_INSTALL_OPT_STRACE">--strace</entry>
+
+ <!-- options for action show -->
+ <entry key="SB1_SHOW_OPT_COMPILERS">--compilers</entry>
+ <entry key="SB1_SHOW_OPT_DEVKITS">--devkits</entry>
+ <entry key="SB1_SHOW_OPT_CPU">--cputransp</entry>
+ <entry key="SB1_SHOW_OPT_COMP_ARCH">--compiler-arch</entry>
+ <entry key="SB1_SHOW_OPT_COMP_SUBARCH">--compiler-subarch</entry>
+ <entry key="SB1_SHOW_OPT_COMP_CLIB">--compiler-clib</entry>
+
+ <!-- options for action list -->
+ <entry key="SB1_LIST_OPT_COMPILERS">--compilers</entry>
+ <entry key="SB1_LIST_OPT_DEVKITS">--devkits</entry>
+ <entry key="SB1_LIST_OPT_CPU">--cputransps</entry>
+ <entry key="SB1_LIST_OPT_TARGETS">--targets</entry>
+ <entry key="SB1_LIST_OPT_SESSIONS">--sessions</entry>
+
+ <!-- setting such as Scratchbox location and user name -->
+ <entry key="SB1_SBOX_SANDBOX">/scratchbox/users/${USER}</entry>
+
+</properties>
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/plugin.xml
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/plugin.xml (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/plugin.xml 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.maemo.mica.common.core.sdk_provider">
+ <sdk_provider
+ class="org.maemo.esbox.internal.scratchbox.sb1.provider.Scratchbox1SDKProvider">
+ </sdk_provider>
+ </extension>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.maemo.mica.common.ui.preferenceCategory.maemo"
+ class="org.maemo.esbox.internal.scratchbox.sb1.ui.preferences.Scratchbox1PreferencesPage"
+ id="org.maemo.mica.maemosdk.sb1.preferencePage.sb1"
+ name="Scratchbox 1">
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.adapters">
+ <factory
+ adaptableType="org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDK"
+ class="org.maemo.esbox.internal.scratchbox.sb1.ui.adapters.MaemoScratchbox1SDKManageTargetAdapterFactory">
+ <adapter
+ type="org.maemo.mica.common.core.adapters.ISDKManageTargetAdapter">
+ </adapter>
+ </factory>
+ </extension>
+ <extension
+ point="org.maemo.mica.common.core.preference_set_provider">
+ <preferenceSetProvider
+ defaultsXMLFile="conf/sb1_prefs.xml"
+ preferenceConstantsClass="org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants"
+ preferenceMigratorClass="org.maemo.mica.internal.api.common.core.OldESboxPreferenceMigrator"
+ preferenceStoreBundle="org.maemo.esbox.scratchbox.sb1"
+ version="17">
+ </preferenceSetProvider>
+ </extension>
+
+</plugin>
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/Activator.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/Activator.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/Activator.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,146 @@
+package org.maemo.esbox.internal.scratchbox.sb1;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import org.maemo.mica.common.core.ErrorLogger;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.maemo.mica.maemosdk.sdk1";
+
+ // The shared instance
+ private static Activator plugin;
+
+ private IPreferenceStore preferenceStore;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Return the error logger instance of this plug-in.
+ *
+ * @return the error logger instance of this plug-in.
+ */
+ public static ErrorLogger getErrorLogger() {
+ class CoreErrorLogger extends ErrorLogger {
+
+ @Override
+ public String getPluginID() {
+ return PLUGIN_ID;
+ }
+
+ @Override
+ public Plugin getPlugin() {
+ return Activator.getDefault();
+ }
+
+ }
+
+ return new CoreErrorLogger();
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given plug-in
+ * relative path.
+ *
+ * @param path
+ * the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ /**
+ * Find a file relative to the plugin, either in a running workspace or a
+ * standalone unit test (assumed to run relative to a plugin)
+ *
+ * @param path
+ */
+ public static InputStream getPluginRelativeInputStream(String path)
+ throws IOException {
+ if (getDefault() != null) {
+ return FileLocator.openStream(getDefault().getBundle(), new Path(
+ path), false);
+ } else {
+ return new FileInputStream("../" + path);
+ }
+ }
+
+ /**
+ * Returns the preference store for this UI plug-in. This preference store
+ * is used to hold persistent settings for this plug-in in the context of a
+ * workbench. Some of these settings will be user controlled, whereas others
+ * may be internal setting that are never exposed to the user.
+ * <p>
+ * If an error occurs reading the preference store, an empty preference
+ * store is quietly created, initialized with defaults, and returned.
+ * </p>
+ * <p>
+ * <strong>NOTE:</strong> As of Eclipse 3.1 this method is no longer
+ * referring to the core runtime compatibility layer and so plug-ins relying
+ * on Plugin#initializeDefaultPreferences will have to access the
+ * compatibility layer themselves.
+ * </p>
+ *
+ * @return the preference store
+ */
+ public IPreferenceStore getPreferenceStore() {
+ // Create the preference store lazily.
+ if (preferenceStore == null) {
+ preferenceStore = new ScopedPreferenceStore(new InstanceScope(),
+ getBundle().getSymbolicName());
+
+ }
+ return preferenceStore;
+ }
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/AbstractSB1Command.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/AbstractSB1Command.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/AbstractSB1Command.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Petr Baranov (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.command;
+
+import java.security.InvalidParameterException;
+
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.AbstractSDKCommand;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+/**
+ * @author baranov
+ *
+ */
+public abstract class AbstractSB1Command extends AbstractSDKCommand {
+
+ /**
+ * @param commandAbstractor
+ */
+ public AbstractSB1Command(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ // TODO Auto-generated constructor stub
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.maemo.esbox.maemosdk.core.command.AbstractSDKCommand#
+ * replaceScratchboxConfigCommand(java.lang.String, java.lang.String[])
+ */
+ public String replaceScratchboxConfigCommand(String action, String[] options)
+ throws InvalidParameterException {
+ String sboxCommand;
+
+ sboxCommand = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_SBOX_COMMAND);
+
+ return replaceScratchboxCommand(sboxCommand, action, options);
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/CreateTargetCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/CreateTargetCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/CreateTargetCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.command;
+
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDK;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.List;
+
+/**
+ * Creates a new target, if it does not exist. This command wraps the callback
+ * to service sb-conf setup [<TARGET>] [--compiler=<COMPILER>]
+ * [--devkits=<LIST>] [--cputransp=<METHOD>] [--force]
+ *
+ */
+public class CreateTargetCommand extends AbstractSB1Command {
+
+ private IScratchbox1SDK sdk;
+
+ public CreateTargetCommand(IScratchbox1SDK sdk,
+ ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ this.sdk = sdk;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public Object performCommand(List<String> param) throws ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String targetName = param.get(0);
+ String compilerName = param.get(1);
+ String devkitsNames = param.get(2);
+ String cputranspName = param.get(3);
+
+ String setupTargetAction = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_SETUP_ACT);
+
+ String[] setupActionOptionsReplaced = this.replaceActions(targetName,
+ compilerName, devkitsNames, cputranspName);
+ String setupTargetCommand = this.replaceScratchboxConfigCommand(
+ setupTargetAction, setupActionOptionsReplaced);
+
+ Process process = createProcess(setupTargetCommand, null);
+
+ getInputFromProcessAndWait(process, false, 0);
+
+ sdk.refresh();
+
+ return true;
+ }
+
+ /**
+ * Replace the options of action SETUP. The options of SETUP action are
+ * different from the other ones, so this method replaces the variables
+ * properly.
+ *
+ * @param targetName
+ * the name of the target.
+ *
+ * @param compiler
+ * the compiler name of the target.
+ * @param devkits
+ * the devkits of the target.
+ * @param cputransp
+ * the cputransp method of the target.
+ * @return an array of String with the options already modified with the
+ * options.
+ */
+ protected String[] replaceActions(String targetName, String compiler,
+ String devkits, String cputransp) {
+ String[] setupActions = new String[4];
+ setupActions[0] = targetName;
+ setupActions[1] = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_SETUP_OPT_COMPILER);
+ setupActions[2] = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_SETUP_OPT_DEVKITS);
+ setupActions[3] = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_SETUP_OPT_CPUTRANSP);
+
+ setupActions[1] = setupActions[1].replaceAll("\\$\\{COMPILER\\}",
+ compiler);
+ setupActions[2] = setupActions[2].replaceAll("\\$\\{LIST\\}", devkits);
+ setupActions[3] = setupActions[3].replaceAll("\\$\\{METHOD\\}",
+ cputransp);
+
+ return setupActions;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.maemosdk.core.command.ScratchboxCommand#getParametersSize
+ * ()
+ */
+ public int getParametersSize() {
+ return 4;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/GetCurrentTargetCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/GetCurrentTargetCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/GetCurrentTargetCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.command;
+
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDK;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.List;
+
+/**
+ * Get the current Scratchbox 1 target. This command wraps the callback to
+ * service sb-conf current
+ */
+public class GetCurrentTargetCommand extends AbstractSB1Command {
+
+ private final IScratchbox1SDK sdk;
+
+ public GetCurrentTargetCommand(ICommandAbstractor commandAbstractor,
+ IScratchbox1SDK sdk) {
+ super(commandAbstractor);
+ this.sdk = sdk;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public String performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ if (sdk.getCachedCurrentTarget() != null)
+ return sdk.getCachedCurrentTarget();
+
+ String currentTargetAction = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_CURRENT_ACT);
+ String currentTargetCommand = this
+ .replaceScratchboxConfigCommand(currentTargetAction);
+
+ Process process = createProcess(currentTargetCommand, null);
+
+ String currentTarget = getInputFromProcessAndWait(process, true, 0);
+
+ sdk.setCachedCurrentTarget(currentTarget);
+ return currentTarget;
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 0;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/GetGdbQemuCommandPatternCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/GetGdbQemuCommandPatternCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/GetGdbQemuCommandPatternCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.command;
+
+import org.eclipse.core.runtime.IStatus;
+import org.maemo.esbox.internal.scratchbox.sb1.Activator;
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.SBPreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+import org.osgi.framework.Version;
+
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Get the command pattern for launching qemu with the debugger
+ *
+ * @author eswartz
+ *
+ */
+public class GetGdbQemuCommandPatternCommand extends AbstractSB1Command {
+
+ private IScratchboxSDKTarget sdkTarget;
+
+ public GetGdbQemuCommandPatternCommand(IScratchboxSDKTarget sdkTarget,
+ ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ this.sdkTarget = sdkTarget;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public String performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String commandPattern = null;
+
+ String architecture = param.get(0);
+
+ if (architecture.equals(IScratchboxSDKTarget.ARCHITECTURE_ARMEL)) {
+ // scratchbox often misconfigures the softlinks, so explicitly
+ // launch the qemu configured for the target
+ String qemu = getConfiguredQemu();
+ if (qemu == null) {
+ // fallback
+ Activator
+ .getErrorLogger()
+ .log(
+ IStatus.WARNING,
+ "Target "
+ + sdkTarget
+ + " does not seem to use qemu, so assuming qemu-arm for debugging",
+ null);
+ qemu = "qemu-arm";
+ }
+ // get the version
+ Version version = null;
+ Pattern versionPattern = Pattern
+ .compile("qemu-.*((\\d+)\\.(\\d+)\\.(\\d+))-.*");
+ Matcher matcher = versionPattern.matcher(qemu);
+ if (matcher.matches()) {
+ version = new Version(matcher.group(1));
+ }
+
+ // For ARM emulator debug, use "qemu-arm" command.
+ commandPattern = sdkTarget
+ .getPreferenceValue(SB1PreferenceConstants.SB1_GDB_REMOTE_QEMU);
+
+ if (version != null && version.compareTo(new Version(0, 8, 0)) < 0) {
+ // hide ${PORT}, which doesn't exist in 0.7.x
+ commandPattern = commandPattern.replace("${PORT}", "");
+ // Activator.getErrorLogger().log(IStatus.WARNING,
+ // "The version of qemu-arm in use (" + version +
+ // ") is too old -- debugging may not work. Check your softlinks in /scratchbox/devkits/cputransp/bin/.",
+ // null);
+ }
+
+ commandPattern = commandPattern.replace("${QEMU}", qemu);
+
+ } else {
+ // The others, just standard "gdbserver" command.
+ commandPattern = sdkTarget
+ .getPreferenceValue(SBPreferenceConstants.SBOX_GDB_REMOTE);
+ }
+
+ return commandPattern;
+ }
+
+ /**
+ * Find what qemu is configured for this target.
+ *
+ * @return qemu name, or <code>null</code> if not using qemu
+ */
+ protected String getConfiguredQemu() throws ESboxException {
+
+ // we use sb-select show <target> to find out if qemu is even used for
+ // this target.
+ String showAction = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_SHOW_ACT);
+ String showInfoCommandString = this.replaceScratchboxConfigCommand(
+ showAction, new String[] { sdkTarget.getName() });
+
+ Process process = createProcess(showInfoCommandString, null);
+
+ List<String> lines = getLineInputFromProcessAndWait(process, true, 0);
+
+ // see if this is the line describing CPU transparency
+ Pattern namePattern = Pattern.compile(".*/(qemu-\\S+).*");
+ for (String line : lines) {
+ Matcher matcher = namePattern.matcher(line);
+ if (matcher.matches()) {
+ return matcher.group(1);
+ }
+ }
+
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.maemosdk.core.command.ScratchboxCommand#getParametersSize
+ * ()
+ */
+ public int getParametersSize() {
+ return 1;
+ }
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/GetVersionScratchboxCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/GetVersionScratchboxCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/GetVersionScratchboxCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.command;
+
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.List;
+
+/**
+ * Get the version of Scratchbox installed. This command wraps the callback to
+ * service sb-conf version.
+ *
+ */
+public class GetVersionScratchboxCommand extends AbstractSB1Command {
+
+ public GetVersionScratchboxCommand(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.ScratchboxCommand#getParametersSize()
+ */
+ public int getParametersSize() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .util.List)
+ */
+ public String performCommand(List<String> params)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(params))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String sboxVersionAction;
+ sboxVersionAction = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_VERSION_ACT);
+ String currentSboxVersionCommand = this
+ .replaceScratchboxConfigCommand(sboxVersionAction);
+
+ Process process = createProcess(currentSboxVersionCommand, null);
+
+ String currentVersion = getInputFromProcessAndWait(process, false, 0);
+
+ return currentVersion;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/KillallCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/KillallCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/KillallCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.command;
+
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.List;
+
+/**
+ * Kill all Scratchbox sessions. This command wraps the callback to service
+ * sb-conf killall [-signal=<SIGNAL>]
+ *
+ */
+public class KillallCommand extends AbstractSB1Command {
+
+ public KillallCommand(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public Object performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String signalValue = "";
+ if (param.size() > 0)
+ signalValue = param.get(0);
+
+ String killallAction = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_KILLALL_ACT);
+ String signalOption = this.replaceSignal(signalValue);
+ String killallCommand = this.replaceScratchboxConfigCommand(
+ killallAction, new String[] { signalOption });
+
+ Process process = createProcess(killallCommand, null);
+
+ getInputFromProcessAndWait(process, false, 0);
+
+ return true;
+ }
+
+ /**
+ * Replace the value of SIGNAL option of killall action.
+ *
+ * @param signalValue
+ * the value of the signal to be replaced.
+ * @return the signal option of killall action replaced with the given
+ * signal value.
+ */
+ private String replaceSignal(String signalValue) {
+ if (signalValue.equals(""))
+ return "";
+ String killallSignalOption = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_KILLALL_OPT_SIGNAL);
+
+ String signalReplaced = killallSignalOption.replaceAll(
+ "\\$\\{SIGNAL\\}", signalValue);
+
+ return signalReplaced;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.maemosdk.core.command.ScratchboxCommand#getParametersSize
+ * ()
+ */
+ public int getParametersSize() {
+ return 1;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.maemosdk.core.command.ScratchboxCommand#checkParameters
+ * (java.util.List)
+ */
+ protected boolean checkParameters(List<String> param) {
+ // TODO Auto-generated method stub
+ return getParametersSize() <= 1;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListCompilersCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListCompilersCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListCompilersCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.command;
+
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.List;
+
+/**
+ * List the installed compilers. This command wraps the callback to service
+ * sb-conf list --compilers
+ *
+ */
+public class ListCompilersCommand extends AbstractSB1Command {
+
+ public ListCompilersCommand(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public List<String> performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String listAction = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_LIST_ACT);
+ String compilersOptions = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_LIST_OPT_COMPILERS);
+ String listCompilersCommand = this.replaceScratchboxConfigCommand(
+ listAction, new String[] { compilersOptions });
+
+ Process process = createProcess(listCompilersCommand, null);
+
+ List<String> compilersAvailable = getLineInputFromProcessAndWait(
+ process, true, 0);
+
+ return compilersAvailable;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.maemosdk.core.command.ScratchboxCommand#getParametersSize
+ * ()
+ */
+ public int getParametersSize() {
+ return 0;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListCputranspCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListCputranspCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListCputranspCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.command;
+
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.List;
+
+/**
+ * List the installed cpu-transparency. This command wraps the callback to
+ * service sb-conf list --cputransps
+ *
+ */
+public class ListCputranspCommand extends AbstractSB1Command {
+
+ public ListCputranspCommand(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public List<String> performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String listAction = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_LIST_ACT);
+ String cputranpOption = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_LIST_OPT_CPU);
+ String listCputranspsCommandString = this
+ .replaceScratchboxConfigCommand(listAction,
+ new String[] { cputranpOption });
+
+ Process process = createProcess(listCputranspsCommandString, null);
+
+ List<String> cputranspsAvailable = getLineInputFromProcessAndWait(
+ process, true, 0);
+
+ return cputranspsAvailable;
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 0;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListDevkitsCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListDevkitsCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListDevkitsCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.command;
+
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.List;
+
+/**
+ * List the installed devkits. This command wraps the callback to service
+ * sb-conf list --devkits
+ *
+ */
+public class ListDevkitsCommand extends AbstractSB1Command {
+
+ public ListDevkitsCommand(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public List<String> performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String listAction = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_LIST_ACT);
+ String devkitsOption = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_LIST_OPT_DEVKITS);
+ String listDevkitsCommandString = this.replaceScratchboxConfigCommand(
+ listAction, new String[] { devkitsOption });
+
+ Process process = createProcess(listDevkitsCommandString, null);
+
+ List<String> devkitsAvailable = getLineInputFromProcessAndWait(process,
+ true, 0);
+
+ return devkitsAvailable;
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 0;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListSessionsCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListSessionsCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListSessionsCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.command;
+
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * List the current Scratchbox sessions. This command wraps the callback to
+ * service sb-conf list --sessions
+ *
+ */
+public class ListSessionsCommand extends AbstractSB1Command {
+
+ public ListSessionsCommand(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public List<String> performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String listAction = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_LIST_ACT);
+ String sessionsOption = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_LIST_OPT_SESSIONS);
+ String listSessionsCommandString = this.replaceScratchboxConfigCommand(
+ listAction, new String[] { sessionsOption });
+
+ Process process = createProcess(listSessionsCommandString, null);
+
+ List<String> sessionLines = getLineInputFromProcessAndWait(process,
+ true, 0);
+
+ List<String> sessionsAvailable = new ArrayList<String>();
+
+ // remove prefix text
+ for (String line : sessionLines) {
+ int idx = line.indexOf(':');
+ if (idx >= 0) {
+ String[] pids = line.substring(idx + 1).split("\\s+");
+ for (String pid : pids) {
+ pid = pid.trim();
+ if (pid.length() > 0)
+ sessionsAvailable.add(pid);
+ }
+ }
+ }
+
+ return sessionsAvailable;
+ }
+
+ public int getParametersSize() {
+ return 0;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListTargetsCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListTargetsCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ListTargetsCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.command;
+
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.List;
+
+/**
+ * List the installed targets. This command wraps the callback to service (sb1)
+ * sb-conf list --targets or sb2-config -l (sb2)
+ *
+ */
+public class ListTargetsCommand extends AbstractSB1Command {
+
+ public ListTargetsCommand(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public List<String> performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String listAction;
+ String targetsOption;
+ listAction = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_LIST_ACT);
+ targetsOption = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_LIST_OPT_TARGETS);
+ String listTargetsCommandString = this.replaceScratchboxConfigCommand(
+ listAction, new String[] { targetsOption });
+
+ Process process = createProcess(listTargetsCommandString, null);
+
+ List<String> targetsAvailable = getLineInputFromProcessAndWait(process,
+ true, 0);
+
+ return targetsAvailable;
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 0;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/RemoveTargetCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/RemoveTargetCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/RemoveTargetCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.command;
+
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.ISDK;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Remove a Scratchbox target. This command wraps the callback to service
+ * sb-conf remove [<TARGET>]
+ *
+ */
+public class RemoveTargetCommand extends AbstractSB1Command {
+
+ private ISDK sdk;
+
+ public RemoveTargetCommand(ISDK sdk, ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ this.sdk = sdk;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public Object performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String targetToRemove = param.get(0);
+ if (!targetExist(targetToRemove))
+ throw new ScratchboxInvalidParameterException("Target "
+ + targetToRemove + " does not exist.");
+
+ String removeTargetAction = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_REMOVE_ACT);
+ String forceRemoveTargetOption = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_REMOVE_OPT_FORCE);
+ String removeTargetCommand = this.replaceScratchboxConfigCommand(
+ removeTargetAction, new String[] { targetToRemove,
+ forceRemoveTargetOption });
+
+ Process process = createProcess(removeTargetCommand, null);
+
+ getInputFromProcessAndWait(process, true, 0);
+
+ sdk.refresh();
+
+ return true;
+ }
+
+ /**
+ * Verify if a target exists.
+ *
+ * @param targetToRemove
+ * the target to verify.
+ *
+ * @return true, if the target exists in Scratchbox; false, otherwise.
+ * @throws ScratchboxException
+ * if some problem occurrs while requesting Scratchbox services.
+ */
+ private boolean targetExist(String targetToRemove) throws ESboxException {
+ List<String> targetsAvailable = new ListTargetsCommand(
+ commandAbstractor).performCommand(new ArrayList<String>());
+ return targetsAvailable.contains(targetToRemove);
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 1;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ResetTargetCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ResetTargetCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ResetTargetCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.command;
+
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.List;
+
+/**
+ * Reset a Scratchbox target. This command wraps the callback to service sb-conf
+ * reset [<TARGET>]
+ *
+ */
+public class ResetTargetCommand extends AbstractSB1Command {
+
+ public ResetTargetCommand(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .util.List)
+ */
+ public Object performCommand(List<String> params)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(params))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String resetTargetAction = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_RESET_ACT);
+ String resetTargetCommand = this.replaceScratchboxConfigCommand(
+ resetTargetAction, new String[] {});
+
+ Process process = createProcess(resetTargetCommand, null);
+
+ getInputFromProcessAndWait(process, false, 0);
+
+ return true;
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 0;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/RootstrapCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/RootstrapCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/RootstrapCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.command;
+
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.List;
+
+/**
+ * This command wraps the callback to service sb-conf rootstrap [<TARGET>]
+ * <FILE>|<URL>
+ */
+public class RootstrapCommand extends AbstractSB1Command {
+
+ public RootstrapCommand(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public Object performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String fileOrURL = param.get(0);
+
+ String rootstrapAction = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_ROOTSTRAP_ACT);
+ String rootstrapCommand = this.replaceScratchboxConfigCommand(
+ rootstrapAction, new String[] { fileOrURL });
+
+ Process process = createProcess(rootstrapCommand, null);
+
+ getInputFromProcessAndWait(process, false, 0);
+
+ return true;
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 1;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/SelectTargetCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/SelectTargetCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/SelectTargetCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.command;
+
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDK;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.List;
+
+/**
+ * Select a Scratchbox target. This command wraps the callback to service
+ * sb-conf select [<TARGET>]
+ *
+ */
+public class SelectTargetCommand extends AbstractSB1Command {
+
+ private final IScratchboxSDK sdk;
+
+ public SelectTargetCommand(ICommandAbstractor commandAbstractor,
+ IScratchboxSDK sdk) {
+ super(commandAbstractor);
+ this.sdk = sdk;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public Object performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String targetToSelect = param.get(0);
+
+ String selectTargetAction = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_SELECT_ACT);
+ String selectTargetCommand = this.replaceScratchboxConfigCommand(
+ selectTargetAction, new String[] { targetToSelect });
+
+ Process process = createProcess(selectTargetCommand, null);
+
+ getInputFromProcessAndWait(process, false, 0);
+
+ sdk.setCachedCurrentTarget(targetToSelect);
+
+ return true;
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 1;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ShowTargetCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ShowTargetCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/command/ShowTargetCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.command;
+
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxTarget;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.*;
+
+/**
+ * Show the settings of a Scratchbox target. This command wraps the callback to
+ * service sb-conf show [<TARGET>]
+ *
+ */
+public class ShowTargetCommand extends AbstractSB1Command {
+
+ public ShowTargetCommand(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.common.core.internal.command.ICommand#performCommand(java.util
+ * .List)
+ */
+ public ScratchboxTarget performCommand(List<String> params)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(params))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String listAction = commandAbstractor
+ .getPreferenceValue(SB1PreferenceConstants.SB1_SHOW_ACT);
+ String showTargetCommandString = this.replaceScratchboxConfigCommand(
+ listAction, new String[] { params.get(0) });
+
+ Process process = createProcess(showTargetCommandString, null);
+
+ ScratchboxTarget target = null;
+ List<String> targetInfo = getLineInputFromProcessAndWait(process,
+ false, 0);
+ target = createTarget(params.get(0), targetInfo);
+
+ return target;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.maemo.esbox.core.scratchbox.internal.command.ScratchboxCommand#
+ * getParametersSize()
+ */
+ @Override
+ public int getParametersSize() {
+ // TODO Auto-generated method stub
+ return 1;
+ }
+
+ private ScratchboxTarget createTarget(String targetName,
+ List<String> targetInfo) {
+ ScratchboxTarget target = new ScratchboxTarget();
+
+ target.setName(targetName);
+
+ String compilerField = targetInfo.get(0);
+ String compiler = compilerField.substring(
+ compilerField.indexOf(":") + 1).trim();
+ target.setCompiler(compiler);
+
+ String devkitsField = targetInfo.get(1);
+ devkitsField = devkitsField.substring(devkitsField.indexOf(":") + 1);
+ StringTokenizer tokens = new StringTokenizer(devkitsField);
+ List<String> devkits = new ArrayList<String>();
+ while (tokens.hasMoreTokens()) {
+ devkits.add(tokens.nextToken());
+ }
+ target.setDevkits(devkits);
+
+ String cputranspField = targetInfo.get(2);
+ String cpuTransp = cputranspField.substring(
+ cputranspField.indexOf(":") + 1).trim();
+ target.setCputransp(cpuTransp);
+
+ return target;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/SB1PreferenceConstants.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/SB1PreferenceConstants.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/SB1PreferenceConstants.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.scratchbox.sb1.core;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.maemo.esbox.internal.scratchbox.sb1.Activator;
+
+/**
+ * This class encapsulates the keys for preference constants defined by
+ * Scratchbox 1.
+ *
+ * @author eswartz
+ *
+ */
+public class SB1PreferenceConstants {
+ public static final int VERSION_MAJOR = 17;
+ public static final int VERSION_MINOR = 0;
+
+ /** Get the preference store that contains these preferences */
+ public static IPreferenceStore getPreferenceStore() {
+ return Activator.getDefault().getPreferenceStore();
+ }
+
+ /* SB1 configuration options */
+
+ public static final String RUN_SCRIPT_LOC = "RUN_SCRIPT_LOC";
+
+ public static final String SB1_GDB_REMOTE_QEMU = "SB1_GDB_REMOTE_QEMU";
+ public static final String SB1_CURRENT_ACT = "SB1_CURRENT_ACT";
+ public static final String SB1_SBOX_COMMAND = "SB1_SBOX_COMMAND";
+ public static final String SB1_REMOVE_ACT = "SB1_REMOVE_ACT";
+ public static final String SB1_REMOVE_OPT_FORCE = "SB1_REMOVE_OPT_FORCE";
+ public static final String SB1_RESET_ACT = "SB1_RESET_ACT";
+ public static final String SB1_ROOTSTRAP_ACT = "SB1_ROOTSTRAP_ACT";
+ public static final String SB1_ROOTSTRAP_OPT_FORCE = "SB1_ROOTSTRAP_OPT_FORCE";
+ public static final String SB1_INSTALL_ACT = "SB1_INSTALL_ACT";
+ public static final String SB1_INSTALL_OPT_CLIB = "SB1_INSTALL_OPT_CLIB";
+ public static final String SB1_INSTALL_OPT_DEVKITS = "SB1_INSTALL_OPT_DEVKITS";
+ public static final String SB1_INSTALL_OPT_ETC = "SB1_INSTALL_OPT_ETC";
+ public static final String SB1_INSTALL_OPT_FAKE = "SB1_INSTALL_OPT_FAKE";
+ public static final String SB1_INSTALL_OPT_GDB = "SB1_INSTALL_OPT_GDB";
+ public static final String SB1_INSTALL_OPT_STRACE = "SB1_INSTALL_OPT_STRACE";
+ public static final String SB1_KILLALL_ACT = "SB1_KILLALL_ACT";
+ public static final String SB1_KILLALL_OPT_SIGNAL = "SB1_KILLALL_OPT_SIGNAL";
+ public static final String SB1_LIST_ACT = "SB1_LIST_ACT";
+ public static final String SB1_LIST_OPT_COMPILERS = "SB1_LIST_OPT_COMPILERS";
+ public static final String SB1_LIST_OPT_CPU = "SB1_LIST_OPT_CPU";
+ public static final String SB1_LIST_OPT_DEVKITS = "SB1_LIST_OPT_DEVKITS";
+ public static final String SB1_LIST_OPT_SESSIONS = "SB1_LIST_OPT_SESSIONS";
+ public static final String SB1_LIST_OPT_TARGETS = "SB1_LIST_OPT_TARGETS";
+ public static final String SB1_LOGIN_COMMAND = "SB1_LOGIN_COMMAND";
+ public static final String SB1_SBOX_SANDBOX = "SB1_SBOX_SANDBOX";
+ public static final String SB1_SELECT_ACT = "SB1_SELECT_ACT";
+ public static final String SB1_SETUP_ACT = "SB1_SETUP_ACT";
+ public static final String SB1_SETUP_OPT_COMPILER = "SB1_SETUP_OPT_COMPILER";
+ public static final String SB1_SETUP_OPT_CPUTRANSP = "SB1_SETUP_OPT_CPUTRANSP";
+ public static final String SB1_SETUP_OPT_DEVKITS = "SB1_SETUP_OPT_DEVKITS";
+ public static final String SB1_SETUP_OPT_FORCE = "SB1_SETUP_OPT_FORCE";
+ public static final String SB1_SHOW_ACT = "SB1_SHOW_ACT";
+ public static final String SB1_SHOW_OPT_COMP_ARCH = "SB1_SHOW_OPT_COMP_ARCH";
+ public static final String SB1_SHOW_OPT_COMP_CLIB = "SB1_SHOW_OPT_COMP_CLIB";
+ public static final String SB1_SHOW_OPT_COMP_SUBARCH = "SB1_SHOW_OPT_COMP_SUBARCH";
+ public static final String SB1_SHOW_OPT_COMPILERS = "SB1_SHOW_OPT_COMPILERS";
+ public static final String SB1_SHOW_OPT_CPU = "SB1_SHOW_OPT_CPU";
+ public static final String SB1_SHOW_OPT_DEVKITS = "SB1_SHOW_OPT_DEVKITS";
+ public static final String SB1_VERSION_ACT = "SB1_VERSION_ACT";
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1FileSystemMapping.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1FileSystemMapping.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1FileSystemMapping.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,70 @@
+/**
+ * (c) 2008 Nokia
+ */
+package org.maemo.esbox.internal.scratchbox.sb1.core;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.maemo.mica.internal.api.common.core.machine.FileSystemMapping;
+
+import com.nokia.cpp.internal.api.utils.core.Pair;
+
+/**
+ * Represent the mappings from the machine to a Scratchbox 1 target running on
+ * the machine. This represents the direct mappings with all softlinks resolved
+ * (so, not "/scratchbox/users/user/usr" but
+ * "/scratchbox/users/user/targets/CHINOOK_ARMEL/usr")
+ *
+ * @author eswartz
+ *
+ */
+public class Scratchbox1FileSystemMapping extends FileSystemMapping {
+
+ /**
+ * Construct with default Linux path canonicalizers and add mappings for
+ * paths known to be mapped.
+ *
+ * @param targetRoot
+ * @param target
+ */
+ public Scratchbox1FileSystemMapping(IPath scratchboxBase, String target,
+ String user) {
+
+ super(FileSystemMapping.getMachineCanonicalizer(true),
+ FileSystemMapping.getMachineCanonicalizer(true));
+
+ List<Pair<IPath, IPath>> mappings = getHostToTargetRootMappings();
+ mappings.clear();
+
+ // directories that are the same for all targets
+ String[] topLevelDirs = { "dev", "home", "host_usr", "proc",
+ "scratchbox", "sys", "targets" };
+
+ IPath sharedBase = scratchboxBase;
+ map(mappings, sharedBase, new Path("/"));
+ for (String topLevelDir : topLevelDirs) {
+ map(mappings, sharedBase.append(topLevelDir), new Path(topLevelDir)
+ .makeAbsolute());
+ }
+
+ // directories that depend on the current target
+ String[] topLevelLinks = { "bin", "boot", "cdrom", "etc", "floppy",
+ "initrd", "lib", "media", "mnt", "opt", "root", "sbin", "srv",
+ "usr", "var" };
+
+ IPath perTargetBase = scratchboxBase.append("targets").append(target);
+ for (String topLevelDir : topLevelLinks) {
+ map(mappings, perTargetBase.append(topLevelDir), new Path(
+ topLevelDir).makeAbsolute());
+ }
+
+ setHostToTargetRootMappings(mappings);
+ }
+
+ private void map(List<Pair<IPath, IPath>> mappings, IPath from, IPath to) {
+ mappings.add(new Pair<IPath, IPath>(from, to));
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDK.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDK.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDK.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,366 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Petr Baranov (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.core;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.maemo.esbox.internal.api.scratchbox.core.sdk.*;
+import org.maemo.esbox.internal.scratchbox.sb1.Activator;
+import org.maemo.esbox.internal.scratchbox.sb1.command.*;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDK;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.machine.IMachine;
+import org.maemo.mica.common.core.machine.MachineUtils;
+import org.maemo.mica.common.core.sdk.*;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+import org.maemo.mica.internal.api.common.core.sdk.BaseSDKPlatform;
+import org.maemo.mica.maemosdk.core.MaemoSDKEngine;
+import org.maemo.mica.maemosdk.core.MaemoSDKInfo;
+
+import java.util.*;
+
+public class Scratchbox1SDK extends AbstractScratchboxSDK implements
+ IScratchbox1SDK {
+
+ private IPath sdkRoot;
+ /** String for URI of machine where we detected scratchbox 1 */
+ static final String SB1_MACHINE = "sb1_machine";
+ /** String for scratchbox 1 version or <code>null</code> */
+ static final String SB1_VERSION = "sb1_version";
+
+ public Scratchbox1SDK(IMachine machine, String version,
+ IPreferenceProvider prefProvider) {
+ super(machine, version, IScratchbox1SDK.NAME, "sb1_machine",
+ "sb1_version", "sb1_targets", 1);
+ this.sdkRoot = null;
+ this.prefProvider = prefProvider;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.maemosdk.core.sdk.AbstractScratchboxSDK#refresh()
+ */
+ public void refresh() {
+ super.refresh();
+ try {
+ List<String> targetNames = getTargets();
+ List<ISDKTarget> newTargets = new ArrayList<ISDKTarget>();
+ for (String target : targetNames) {
+ IPath sb1TargetRoot = getSDKRoot()
+ .append("targets").append(target); //$NON-NLS-1$
+ ISDKTarget sdkTarget = new Scratchbox1SDKTarget(this,
+ getPlatform(target), getArchitecture(target), target,
+ sb1TargetRoot);
+ newTargets.add(sdkTarget);
+ }
+ this.targets = newTargets;
+ } catch (ESboxException e) {
+ Activator.getErrorLogger().logError("Could not refresh targets", e);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.maemosdk.core.sdk.AbstractScratchboxSDK#getCommandAbstractor
+ * ()
+ */
+ public ICommandAbstractor getCommandAbstractor() throws ESboxException {
+ return getSb1WrappedAbstractor(super.getCommandAbstractor(), this
+ .getMachine());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.maemosdk.core.sdk.IScratchboxSDK#createTarget(java.lang
+ * .String, java.lang.String, java.lang.String, java.lang.String)
+ */
+ public boolean createTarget(String targetName, String compiler,
+ String devkits, String cputransp) throws ESboxException {
+ List<String> params = new ArrayList<String>();
+ params.add(targetName);
+ params.add(compiler);
+ params.add(devkits);
+ params.add(cputransp);
+
+ CreateTargetCommand createTargetCommand = new CreateTargetCommand(this,
+ getCommandAbstractor());
+
+ CacheUtils.getInstance().setCachedValue(SB_TARGETS, null);
+ return (Boolean) createTargetCommand.performCommand(params);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.maemosdk.core.sdk.IScratchboxSDK#getCompilers()
+ */
+ public List<String> getCompilers() throws ESboxException {
+ ListCompilersCommand listCompilersCommand = new ListCompilersCommand(
+ getCommandAbstractor());
+ return listCompilersCommand.performCommand(EMPTY_ARGS);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.maemosdk.core.sdk.IScratchboxSDK#getCputransp()
+ */
+ public List<String> getCputransp() throws ESboxException {
+ ListCputranspCommand listCputranspCommand = new ListCputranspCommand(
+ getCommandAbstractor());
+ return listCputranspCommand.performCommand(EMPTY_ARGS);
+ }
+
+ /**
+ * Return the current version of Scratchbox 1.
+ *
+ * @param machine
+ * @return the current version of Scratchbox 1.
+ * @throws ESboxException
+ * if any problem related to Scratchbox communication occurs,
+ * including no scratchbox 1 detected
+ */
+ public static String getCurrentSboxVersion(IMachine machine)
+ throws ESboxException {
+ // find cached value
+ CacheUtils.getInstance().ensureCurrentMachine(SB1_MACHINE, machine);
+ String version = (String) CacheUtils.getInstance().getCachedValue(
+ SB1_VERSION);
+ if (version != null)
+ return version;
+
+ // do the hard work
+ MachineUtils.acquireMachine(machine);
+ ICommandAbstractor commandAbstractor = MachineUtils
+ .getHostCommandAbstractor(machine);
+ commandAbstractor = getSb1WrappedAbstractor(commandAbstractor, machine);
+ GetVersionScratchboxCommand getVersionCommand = new GetVersionScratchboxCommand(
+ commandAbstractor);
+
+ String currentVersion = getVersionCommand
+ .performCommand(new ArrayList<String>());
+
+ // remember cached value
+ CacheUtils.getInstance().setCachedValue(SB1_VERSION, currentVersion);
+
+ return currentVersion;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.maemosdk.core.sdk.IScratchboxSDK#getCurrentTarget()
+ */
+ public String getCurrentTarget() throws ESboxException {
+ GetCurrentTargetCommand getCurrentTargetCommand = new GetCurrentTargetCommand(
+ getCommandAbstractor(), this);
+ return (String) getCurrentTargetCommand
+ .performCommand(new ArrayList<String>());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.maemosdk.core.sdk.IScratchboxSDK#getTargets()
+ */
+ public List<String> getTargets() throws ESboxException {
+ CacheUtils.getInstance().ensureCurrentMachine(SB_MACHINE, this.getMachine());
+
+ String[] targetsArray = (String[]) CacheUtils.getInstance()
+ .getCachedValue(SB_TARGETS);
+ if (targetsArray != null)
+ return Arrays.asList(targetsArray);
+
+ ListTargetsCommand listTargetsCommand = new ListTargetsCommand(
+ getCommandAbstractor());
+ List<String> targets = listTargetsCommand
+ .performCommand(new ArrayList<String>());
+
+ CacheUtils.getInstance().setCachedValue(SB_TARGETS,
+ (String[]) targets.toArray(new String[targets.size()]));
+
+ return targets;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.common.core.sdk.ISDK#getSDKRoot()
+ */
+ public IPath getSDKRoot() {
+ if (sdkRoot == null) {
+ String userPath = prefProvider
+ .getPreferenceValue(SB1PreferenceConstants.SB1_SBOX_SANDBOX);
+ sdkRoot = new Path(userPath);
+ }
+ return sdkRoot;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.maemosdk.core.sdk.IScratchboxSDK#removeTarget(java.lang
+ * .String)
+ */
+ public boolean removeTarget(String targetName) throws ESboxException {
+ List<String> params = new ArrayList<String>();
+ params.add(targetName);
+
+ RemoveTargetCommand removeTargetCommand;
+
+ removeTargetCommand = new RemoveTargetCommand(this,
+ getCommandAbstractor());
+ CacheUtils.getInstance().setCachedValue(SB_TARGETS, null);
+
+ return (Boolean) removeTargetCommand.performCommand(params);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.maemosdk.sb1.core.IScratchbox1SDK#getDevkits()
+ */
+ public List<String> getDevkits() throws ESboxException {
+ ListDevkitsCommand listDevkitsCommand = new ListDevkitsCommand(
+ getCommandAbstractor());
+ return listDevkitsCommand.performCommand(new ArrayList<String>());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.maemosdk.sb1.core.IScratchbox1SDK#getSessions()
+ */
+ public List<String> getSessions() throws ESboxException {
+ ListSessionsCommand listSessionsCommand = new ListSessionsCommand(
+ getCommandAbstractor());
+ return listSessionsCommand.performCommand(new ArrayList<String>());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.maemosdk.sb1.core.IScratchbox1SDK#killProcess()
+ */
+ public boolean killProcess() throws ESboxException {
+ List<String> params = new ArrayList<String>();
+ KillallCommand killallCommand = new KillallCommand(
+ getCommandAbstractor());
+ return (Boolean) killallCommand.performCommand(params);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.maemosdk.sb1.core.IScratchbox1SDK#killProcess(java.lang
+ * .String)
+ */
+ public boolean killProcess(String signal) throws ESboxException {
+ List<String> params = new ArrayList<String>();
+ params.add(signal);
+ KillallCommand killallCommand = new KillallCommand(
+ getCommandAbstractor());
+ return (Boolean) killallCommand.performCommand(params);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.maemosdk.sb1.core.IScratchbox1SDK#selectTarget(java.lang
+ * .String)
+ */
+ public boolean selectTarget(String targetName) throws ESboxException {
+ List<String> params = new ArrayList<String>();
+ params.add(targetName);
+
+ SelectTargetCommand selectTargetCommand = new SelectTargetCommand(
+ getCommandAbstractor(), this);
+
+ return (Boolean) selectTargetCommand.performCommand(params);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.maemo.esbox.internal.maemosdk.core.sdk.
+ * IScratchboxSDKPlatformArchitectureProvider
+ * #getArchitecture(java.lang.String)
+ */
+ public String getArchitecture(String target) {
+ // convention says this is the part of the target after the underscore
+ int idx = target.lastIndexOf('_');
+ if (idx > 0)
+ return target.substring(idx + 1).toUpperCase();
+ else
+ return IScratchboxSDKTarget.ARCHITECTURE_UNKNOWN;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.maemo.esbox.internal.maemosdk.core.sdk.
+ * IScratchboxSDKPlatformArchitectureProvider#getPlatform(java.lang.String)
+ */
+ public ISDKPlatform getPlatform(String target) {
+ // convention says this is the part of the target before the underscore,
+ // usually the name of the platform directly, except for aberrant 'SDK'
+ // cases
+ int idx = target.lastIndexOf('_');
+ String platformName = ISDKPlatform.NAME_UNKNOWN;
+ String version = ISDKPlatform.VERSION_UNKNOWN;
+ if (idx >= 1) {
+ String platform = target.substring(0, idx);
+ // the 'SDK' one is a hard nut to crack
+ if (!platform.equalsIgnoreCase("SDK")) {
+ platformName = platform.substring(0, 1).toUpperCase()
+ + platform.substring(1).toLowerCase();
+
+ List<MaemoSDKInfo> maemoSDKS = MaemoSDKEngine.getInstance()
+ .getMaemoSDKS();
+ for (MaemoSDKInfo info : maemoSDKS) {
+ if (info.getName().equalsIgnoreCase(platformName)) {
+ version = info.getVersion();
+ break;
+ }
+ }
+ } else {
+ // TODO: look at key files or versions to determine the
+ // platform from the SDK target contents
+ }
+ }
+ return new BaseSDKPlatform(platformName, version);
+ }
+
+ /**
+ * Get a command abstractor that updates the PATH if sb1 tools are not on
+ * the path.
+ *
+ * @param commandAbstractor
+ * @param machine
+ * @return
+ */
+ private static ICommandAbstractor getSb1WrappedAbstractor(
+ ICommandAbstractor commandAbstractor, IMachine machine) {
+ // XXX: the default path should be provided some other way
+ return wrapCommandAbstractorForSDK(commandAbstractor, machine,
+ "sb-conf", "/scratchbox/tools/bin");
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDKTarget.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDKTarget.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDKTarget.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Petr Baranov (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.core;
+
+import org.eclipse.core.runtime.IPath;
+import org.maemo.esbox.internal.api.scratchbox.core.sdk.AbstractScratchboxSDKTarget;
+import org.maemo.esbox.internal.scratchbox.sb1.command.GetGdbQemuCommandPatternCommand;
+import org.maemo.esbox.internal.scratchbox.sb1.launcher.Scratchbox1ProcessLauncherFactory;
+import org.maemo.mica.common.core.CorePreferenceConstants;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.process.IProcessLauncherFactory;
+import org.maemo.mica.common.core.sdk.ISDKPlatform;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * SDK target for Scratchbox 1
+ *
+ * @author baranov
+ *
+ */
+public class Scratchbox1SDKTarget extends AbstractScratchboxSDKTarget {
+
+ private IPath targetRoot;
+
+ public Scratchbox1SDKTarget(Scratchbox1SDK sdk, ISDKPlatform platform,
+ String architecture, String target, IPath targetRoot) {
+ super(sdk, platform, architecture, target);
+ this.targetRoot = targetRoot;
+ init(new Scratchbox1FileSystemMapping(sdk.getSDKRoot(), target, sdk
+ .getPreferenceValue(CorePreferenceConstants.USER)));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget#
+ * getProcessLauncherFactoryForInstall()
+ */
+ public IProcessLauncherFactory getProcessLauncherFactoryForInstall() {
+ return new Scratchbox1ProcessLauncherFactory(this, true);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.maemosdk.core.sdk.IScratchboxSDKTarget#getRootstrapPath()
+ */
+ public IPath getRootstrapPath() {
+ return getSDKTargetRoot();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.common.core.sdk.ISDKTarget#getProcessLauncherFactory()
+ */
+ public IProcessLauncherFactory getProcessLauncherFactory() {
+ return new Scratchbox1ProcessLauncherFactory(this, false);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.common.core.sdk.ISDKTarget#getSDKTargetRoot()
+ */
+ public IPath getSDKTargetRoot() {
+ return targetRoot;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget#
+ * getGdbQemuCommandPattern(java.lang.String)
+ */
+ public synchronized String getGdbQemuCommandPattern(String architecture)
+ throws ESboxException {
+ GetGdbQemuCommandPatternCommand command = new GetGdbQemuCommandPatternCommand(
+ this, this.getCommandAbstractor());
+ List<String> arguments = new ArrayList<String>(1);
+ arguments.add(architecture);
+ return command.performCommand(arguments);
+ }
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1EnvironmentProvider.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1EnvironmentProvider.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1EnvironmentProvider.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.scratchbox.sb1.launcher;
+
+import org.maemo.esbox.internal.scratchbox.sb1.Activator;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.process.*;
+import org.maemo.mica.common.core.process.ProcessLauncherUtils.Results;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.internal.api.common.core.IStandardEnvironmentProvider;
+
+import java.util.*;
+
+/**
+ * The standard environment provider for scratchbox caches the environment once
+ * per SDK target.
+ *
+ * @author eswartz
+ *
+ */
+public class Scratchbox1EnvironmentProvider implements
+ IStandardEnvironmentProvider {
+ public static Map<ISDKTarget, Properties> cachedStdEnvMap = new HashMap<ISDKTarget, Properties>();
+ private final ISDKTarget sdkTarget;
+
+ /**
+ * @param sdkTarget
+ */
+ public Scratchbox1EnvironmentProvider(ISDKTarget sdkTarget) {
+ this.sdkTarget = sdkTarget;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.maemo.esbox.internal.api.core.IStandardEnvironmentProvider#
+ * getRawEnvironment()
+ */
+ public Properties getRawEnvironment() {
+ Properties standardEnv = cachedStdEnvMap.get(sdkTarget);
+ if (standardEnv == null) {
+ // gather arguments by querying a typical shell launched in POSIX
+ // mode (sh instead of bash)
+ Scratchbox1ProcessLauncher launcher = new Scratchbox1ProcessLauncher(
+ sdkTarget, null, CommandLineArguments.createFromVarArgs(
+ "sh", "-c", "set"), null);
+
+ try {
+ Results results = ProcessLauncherUtils
+ .launchAndReadStandardStreams(launcher, null);
+ standardEnv = EnvironmentProperties
+ .createFromShellEnvDump(results.stdout);
+ } catch (ESboxException e) {
+ Activator
+ .getErrorLogger()
+ .logError(
+ "Failed to read scratchbox environment; using system environment",
+ e);
+ standardEnv = sdkTarget.getSDK().getMachine()
+ .getStandardEnvironment();
+ }
+
+ cachedStdEnvMap.put(sdkTarget, standardEnv);
+ }
+ return standardEnv;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.maemo.esbox.internal.api.core.IStandardEnvironmentProvider#
+ * flushRawEnvironment()
+ */
+ public void flushRawEnvironment() {
+ cachedStdEnvMap.remove(sdkTarget);
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1ProcessLauncher.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1ProcessLauncher.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1ProcessLauncher.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,224 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.launcher;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.filesystem.provider.FileInfo;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.maemo.esbox.internal.scratchbox.sb1.Activator;
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.Policy;
+import org.maemo.mica.common.core.env.IEnvironmentModifierBlock;
+import org.maemo.mica.common.core.env.IEnvironmentOperation;
+import org.maemo.mica.common.core.process.*;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * For SB 1, we need to use a "run.sh" wrapper script. The login program does
+ * not conserve variables set outside unless "-k" is passed, but we don't want
+ * to use that anyway, in order to have a clean SB environment.
+ *
+ * @author eswartz
+ *
+ */
+public class Scratchbox1ProcessLauncher extends BaseSDKTargetProcessLauncher implements
+ IProcessLauncher {
+
+ /**
+ * The name of a file copied from the plugin to the sb environment and used
+ * to ensure environment variables can be passed.
+ */
+ private static final String RUN_SCRIPT_NAME = "run.sh";
+
+ private ISDKTarget sdkTarget;
+ private List<String> originalArguments;
+
+ public Scratchbox1ProcessLauncher(ISDKTarget sdkTarget,
+ IPath workingDirectory, List<String> cmdLine,
+ IEnvironmentModifierBlock environmentModifierBlock) {
+ // in SB 1, the working directory, executable, args, and environment
+ // are encoded in a single command to a wrapper script
+ super(encodeArgumentArray(sdkTarget, workingDirectory, cmdLine,
+ environmentModifierBlock), null, null,
+ sdkTarget);
+ if (sdkTarget == null)
+ throw new IllegalArgumentException();
+ this.sdkTarget = sdkTarget;
+ this.originalArguments = cmdLine;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.internal.common.core.BaseProcessLauncher#getLaunchInfoPrefix()
+ */
+ @Override
+ protected String getLaunchInfoPrefix() {
+ return sdkTarget + " ";
+ }
+
+ @Override
+ public String getCommandLineString() {
+ return CommandLineArguments.toCommandLine(originalArguments);
+ }
+
+ private static List<String> encodeArgumentArray(ISDKTarget sdkTarget,
+ IPath workingDirectory, List<String> cmdLine,
+ IEnvironmentModifierBlock environmentModifierBlock) {
+
+ // get the location where the launcher script will be copied on the
+ // target
+ String runScriptLocation = sdkTarget
+ .getPreferenceValue(SB1PreferenceConstants.RUN_SCRIPT_LOC);
+
+ // encode working directory inside scratchbox
+ if (workingDirectory == null) {
+ workingDirectory = new Path("/");
+ }
+
+ List<String> envArgs = encodeEnvironmentModifier(environmentModifierBlock);
+
+ // Encode the launch command by replacing the arguments
+ // representing template arguments with the actual values.
+ //
+ ShellTemplateSubstitutor substitutor = new ShellTemplateSubstitutor();
+
+ substitutor.define("RUN_SCRIPT_DIRECTORY", runScriptLocation);
+ substitutor.define("RUN_SCRIPT", RUN_SCRIPT_NAME);
+ substitutor.define("DIRECTORY", workingDirectory.toPortableString());
+
+ String exportsString = CommandLineArguments.toString(envArgs,
+ ",", false); //$NON-NLS-1$
+
+ substitutor.define("EXPORTS", exportsString);
+ substitutor.define("COMMAND", cmdLine.get(0));
+ substitutor.define("ARGS", CommandLineArguments.toCommandLine(cmdLine
+ .subList(1, cmdLine.size())));
+
+ // get the Scratchbox invocation pattern
+ String commandPattern = sdkTarget
+ .getPreferenceValue(SB1PreferenceConstants.SB1_LOGIN_COMMAND);
+
+ // replace variables
+ commandPattern = substitutor.substitute(commandPattern);
+
+ List<String> commandArgs = CommandLineArguments
+ .createFromCommandLine(commandPattern);
+ return commandArgs;
+ }
+
+ /**
+ * Encode the add/replace and delete operations to run.sh
+ *
+ * @param environmentModifierBlock
+ * @return list of modifier flags
+ */
+ private static List<String> encodeEnvironmentModifier(
+ IEnvironmentModifierBlock environmentModifierBlock) {
+ List<String> mods = new ArrayList<String>();
+ if (environmentModifierBlock != null) {
+ for (IEnvironmentOperation operation : environmentModifierBlock
+ .getOperations()) {
+ if (operation.getValue() == null)
+ mods.add("-" + operation.getName());
+ else
+ mods.add(operation.getName() + "=" + operation.getValue());
+ }
+ }
+ if (mods.isEmpty()) {
+ mods.add("-"); // must have something for the argument to be
+ // detected by run.sh
+ }
+ return mods;
+ }
+
+ /* A flag is the best way to do this -- see below */
+ private static boolean copiedRunScript;
+
+ @Override
+ protected void setupForLaunch() throws ESboxException {
+ super.setupForLaunch();
+
+ // Ensure the run script is available.
+ //
+ // It's a little fishy to check the timestamps, since the timestamp of the
+ // script from the plugin may be extracted from a JAR and always look newer!
+ //
+ // So, just be cautious and set it up once per Eclipse session.
+ //
+ // We don't want to waste time checking contents or being "smart" since
+ // this will just slow things down.
+
+ if (!copiedRunScript) {
+ IFileStore runScriptLocation = sdkTarget
+ .getMachineFileSystemAccess()
+ .getFileStore(
+ new Path(
+ sdkTarget
+ .getPreferenceValue(SB1PreferenceConstants.RUN_SCRIPT_LOC)));
+ IFileStore runScript = runScriptLocation.getChild(RUN_SCRIPT_NAME);
+
+ try {
+ runScriptLocation.mkdir(EFS.NONE, null);
+
+ OutputStream os = null;
+ InputStream is = null;
+ try {
+ os = runScript.openOutputStream(EFS.OVERWRITE, null);
+ is = Activator.getPluginRelativeInputStream("./conf/"
+ + RUN_SCRIPT_NAME);
+ byte[] content = new byte[8192];
+ int len;
+ while ((len = is.read(content)) > 0) {
+ os.write(content, 0, len);
+ }
+ } finally {
+ Policy.close(os);
+ Policy.close(is);
+ }
+
+ FileInfo info = new FileInfo();
+ info.setAttribute(EFS.ATTRIBUTE_EXECUTABLE, true);
+ runScript.putInfo(info, EFS.NONE, null);
+
+ copiedRunScript = true;
+
+ } catch (Exception e) {
+ throw (ScratchboxException) new ScratchboxException(
+ "Cannot copy run script to " + runScript).initCause(e);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.internal.common.core.BaseProcessLauncher#doCreateProcess()
+ */
+ @Override
+ protected Process doCreateProcess() throws Exception {
+ return sdkTarget.getSDK().getMachine().createProcess(
+ getLaunchCurrentWorkingDirectory(),
+ getLaunchCommandArguments(),
+ getLaunchEnvironmentModifierBlock(), isUsePTY());
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1ProcessLauncherFactory.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1ProcessLauncherFactory.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1ProcessLauncherFactory.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.launcher;
+
+import org.eclipse.core.runtime.IPath;
+import org.maemo.mica.common.core.env.IEnvironmentModifierBlock;
+import org.maemo.mica.common.core.process.IProcessLauncher;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.internal.api.common.core.BaseProcessLauncherFactory;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author eswartz
+ *
+ */
+public class Scratchbox1ProcessLauncherFactory extends
+ BaseProcessLauncherFactory {
+
+ protected ISDKTarget sdkTarget;
+ private final boolean runAsRoot;
+
+ public Scratchbox1ProcessLauncherFactory(ISDKTarget sdkTarget,
+ boolean runAsRoot) {
+ super(new Scratchbox1EnvironmentProvider(sdkTarget), false);
+ this.sdkTarget = sdkTarget;
+ this.runAsRoot = runAsRoot;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.common.core.IProcessLauncherFactory#createProcessLauncher(org
+ * .eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath,
+ * org.maemo.mica.common.core.List<String>, java.util.Properties)
+ */
+ protected IProcessLauncher doCreateProcessLauncher(IPath workingDirectory,
+ List<String> cmdLine, IEnvironmentModifierBlock envBlock) {
+
+ if (runAsRoot) {
+ cmdLine = new ArrayList<String>(cmdLine);
+ cmdLine.add(0, "fakeroot");
+ }
+ return new Scratchbox1ProcessLauncher(sdkTarget, workingDirectory,
+ cmdLine, envBlock);
+ }
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/provider/Scratchbox1SDKProvider.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/provider/Scratchbox1SDKProvider.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/provider/Scratchbox1SDKProvider.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.provider;
+
+import org.eclipse.core.runtime.IStatus;
+import org.maemo.esbox.internal.api.scratchbox.core.sdk.CacheUtils;
+import org.maemo.esbox.internal.scratchbox.sb1.Activator;
+import org.maemo.esbox.internal.scratchbox.sb1.core.Scratchbox1SDK;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDK;
+import org.maemo.mica.common.core.*;
+import org.maemo.mica.common.core.machine.IMachine;
+import org.maemo.mica.common.core.machine.MachineRegistry;
+import org.maemo.mica.common.core.sdk.*;
+import org.maemo.mica.internal.api.common.core.sdk.UserAwarePreferenceProviderWrapper;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * This implementation of the SDK provider searches for SB1 targets using the
+ * 'sb-conf list --targets' command. If any aspect of SB1 communication fails,
+ * we assume SB1 is not installed.
+ *
+ * @author eswartz
+ *
+ */
+public class Scratchbox1SDKProvider implements ISDKProvider {
+
+ // only 1.0.x+ supported right now
+ private static final String SCRATCHBOX_VERSION_PATTERN = "1\\.\\d+\\..*"; //$NON-NLS-1$
+
+ /**
+ *
+ */
+ public Scratchbox1SDKProvider() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.common.core.sdk.ISDKProvider#createSDKs()
+ */
+ public List<ISDK> createSDKs() throws ESboxException {
+ ErrorLogger logger = Activator.getErrorLogger();
+
+ List<ISDK> sdks = new ArrayList<ISDK>();
+ for (IMachine machine : MachineRegistry.getInstance()
+ .getBuildMachines()) {
+ try {
+ IPreferenceProvider prefProvider = new UserAwarePreferenceProviderWrapper(
+ CorePreferenceManager.getInstance()
+ .getPreferenceProvider(), machine);
+ IScratchboxSDK sdk = getMachineSDKs(prefProvider, machine);
+ if (sdk != null) {
+ sdks.add(sdk);
+ sdk.refresh();
+ }
+ } catch (ScratchboxException e) {
+ logger.log(IStatus.INFO,
+ "Problem scanning Scratchbox 1 installation", e);
+ }
+ }
+ CacheUtils.getInstance().saveCachedData();
+ return sdks;
+ }
+
+ /**
+ * @param prefProvider
+ * @return
+ * @throws ScratchboxException
+ */
+ private IScratchboxSDK getMachineSDKs(IPreferenceProvider prefProvider,
+ IMachine machine) throws ESboxException {
+ ErrorLogger logger = Activator.getErrorLogger();
+
+ // only support one Scratchbox 1.x installation
+ String version = Scratchbox1SDK.getCurrentSboxVersion(machine);
+ if (version == null) {
+ // no scratchbox?
+ return null;
+ }
+
+ if (!version.matches(SCRATCHBOX_VERSION_PATTERN)) {
+ logger
+ .logError(
+ MessageFormat
+ .format(
+ "Only Scratchbox 1.x is supported (detected {0}); disabling Scratchbox 1 support",
+ version), null);
+ return null;
+ }
+
+ IScratchboxSDK sdk = new Scratchbox1SDK(machine, version, prefProvider);
+
+ return sdk;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.scratchbox.sb1.ui.adapters;
+
+import org.eclipse.core.runtime.*;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.maemo.esbox.internal.api.scratchbox.ui.adapters.MaemoScratchboxSDKManageTargetAdapterBase;
+import org.maemo.esbox.internal.scratchbox.sb1.Activator;
+import org.maemo.esbox.internal.scratchbox.sb1.core.Scratchbox1SDK;
+import org.maemo.esbox.internal.scratchbox.sb1.ui.wizard.NewScratchbox1TargetWizard;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDK;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.Policy;
+import org.maemo.mica.common.core.adapters.ISDKManageTargetAdapter;
+import org.maemo.mica.common.core.sdk.ISDK;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.internal.api.maemosdk.ui.adapters.ESboxTargetRemover;
+
+import java.util.List;
+
+/**
+ * @author eswartz
+ *
+ */
+public class MaemoScratchbox1SDKManageTargetAdapter extends
+ MaemoScratchboxSDKManageTargetAdapterBase implements
+ ISDKManageTargetAdapter {
+
+ private Scratchbox1SDK sdk;
+
+ /**
+ * @param adaptableObject
+ */
+ public MaemoScratchbox1SDKManageTargetAdapter(Scratchbox1SDK sdk) {
+ this.sdk = sdk;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.common.core.adapters.ISDKManageTargetAdapter#installSDKTargets
+ * (org.eclipse.swt.widgets.Shell, java.util.List)
+ */
+ public IStatus installSDKTargets(Shell shell, List<ISDKTarget> installed) {
+ NewScratchbox1TargetWizard targetWizard;
+
+ targetWizard = new NewScratchbox1TargetWizard(sdk);
+ WizardDialog dlg = new WizardDialog(shell, targetWizard);
+ if (dlg.open() == Dialog.OK) {
+ return Status.OK_STATUS;
+ }
+
+ return Policy.getCancelStatus(Activator.getDefault());
+ }
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.maemo.esbox.maemosdk.ui.adapters.
+ * MaemoScratchboxSDKManageTargetAdapterBase
+ * #createTargetRemover(org.eclipse.swt.widgets.Shell,
+ * org.maemo.mica.common.core.sdk.ISDKTarget, boolean)
+ */
+ protected ESboxTargetRemover createTargetRemover(Shell shell,
+ ISDKTarget target, boolean deleteRootstrap) {
+ return new ESboxTargetRemover(shell, target, deleteRootstrap) {
+
+ @Override
+ protected void doDeleteTargetRootstrap(IProgressMonitor monitor,
+ ISDK sdk) {
+ monitor.worked(1);
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.mica.internal.api.maemosdk.ui.adapters.ESboxTargetRemover#doRemoveTarget(org.maemo.mica.common.core.sdk.ISDK, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected void doRemoveTarget(ISDK sdk, String targetName,
+ IProgressMonitor monitor) throws ESboxException {
+ ((IScratchboxSDK) sdk).removeTarget(targetName);
+ monitor.worked(1);
+ }
+ };
+ }
+
+ @Override
+ protected boolean isRootStrapUsed(ISDKTarget selectedTarget) {
+ return false;
+ }
+
+
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapterFactory.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapterFactory.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapterFactory.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.scratchbox.sb1.ui.adapters;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.maemo.esbox.internal.scratchbox.sb1.core.Scratchbox1SDK;
+import org.maemo.mica.common.core.adapters.ISDKManageTargetAdapter;
+
+/**
+ * @author eswartz
+ *
+ */
+public class MaemoScratchbox1SDKManageTargetAdapterFactory implements IAdapterFactory {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object,
+ * java.lang.Class)
+ */
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if (adapterType.equals(ISDKManageTargetAdapter.class)) {
+ if (adaptableObject instanceof Scratchbox1SDK) {
+ return new MaemoScratchbox1SDKManageTargetAdapter(
+ (Scratchbox1SDK) adaptableObject);
+ }
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
+ */
+ public Class[] getAdapterList() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/preferences/Scratchbox1PreferencesPage.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/preferences/Scratchbox1PreferencesPage.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/preferences/Scratchbox1PreferencesPage.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,158 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Paulo Romulo (UFCG) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.scratchbox.sb1.ui.preferences;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.preference.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDK;
+import org.maemo.esbox.scratchbox.core.sdk.ScratchboxSDKFacade;
+import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDK;
+import org.maemo.mica.common.core.machine.ILocalMachine;
+import org.maemo.mica.common.core.sdk.SDKFactory;
+
+/**
+ * General preference page for scratchbox 1
+ *
+ * @author romulo
+ */
+public class Scratchbox1PreferencesPage extends FieldEditorPreferencePage
+ implements IWorkbenchPreferencePage {
+
+ /**
+ * Field for sandbox root
+ */
+ private DirectoryFieldEditor feSandboxRoot = null;
+ private StringFieldEditor feSandboxRootStr = null;
+
+ /**
+ * Field for run scratchbox commands
+ */
+ private StringFieldEditor feSboxCommands = null;
+ protected boolean sdksChanged;
+ private String origSandboxRoot;
+
+ // private StringFieldEditor feGdbQemuCommand;
+
+ /**
+ * The constructor
+ */
+ public Scratchbox1PreferencesPage() {
+ super(GRID);
+ setPreferenceStore(SB1PreferenceConstants.getPreferenceStore());
+ setDescription("Options configuring scratchbox 1");
+ origSandboxRoot = getPreferenceStore().getString(
+ SB1PreferenceConstants.SB1_SBOX_SANDBOX.toString());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors
+ * ()
+ */
+ public void createFieldEditors() {
+ IScratchboxSDK sdk = null;
+ try {
+ sdk = ScratchboxSDKFacade.getInstance().getScratchboxSDK(
+ IScratchbox1SDK.class).get(0);
+ } catch (ScratchboxException e) {
+ }
+ if (false && sdk != null && sdk.getMachine() instanceof ILocalMachine) {
+ feSandboxRoot = new DirectoryFieldEditor(
+ SB1PreferenceConstants.SB1_SBOX_SANDBOX.toString(),
+ "Sandbox root directory:", getFieldEditorParent());
+ addField(feSandboxRoot);
+ feSandboxRoot.getTextControl(getFieldEditorParent())
+ .addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ sdksChanged = true;
+ }
+
+ });
+ } else {
+ feSandboxRootStr = new StringFieldEditor(
+ SB1PreferenceConstants.SB1_SBOX_SANDBOX.toString(),
+ "Sandbox root directory:", getFieldEditorParent());
+ addField(feSandboxRootStr);
+ feSandboxRootStr.getTextControl(getFieldEditorParent())
+ .addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ sdksChanged = true;
+ }
+
+ });
+ }
+
+ feSboxCommands = new StringFieldEditor(
+ SB1PreferenceConstants.SB1_LOGIN_COMMAND.toString(),
+ "Command template:", getFieldEditorParent());
+
+ feSboxCommands
+ .getTextControl(getFieldEditorParent())
+ .setToolTipText(
+ "This setting should only be changed if you have very specific needs, like an alternate run script.");
+
+ // make this string manageable
+ int width;
+ GC gc = new GC(getFieldEditorParent().getShell());
+ width = gc.getAdvanceWidth('m') * 32;
+ gc.dispose();
+
+ GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gridData.widthHint = width;
+ feSboxCommands.getTextControl(getFieldEditorParent()).setLayoutData(
+ gridData);
+
+ addField(feSboxCommands);
+
+ // addField(feGdbQemuCommand);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ public void init(IWorkbench workbench) {
+ // Nothing to do
+ }
+
+ @Override
+ public boolean performOk() {
+ boolean ret = super.performOk();
+ if (ret) {
+ if (sdksChanged) {
+ String curSandboxRoot = getPreferenceStore().getString(
+ SB1PreferenceConstants.SB1_SBOX_SANDBOX.toString());
+ if (!curSandboxRoot.equals(origSandboxRoot)) {
+ SDKFactory.getInstance().refresh(new NullProgressMonitor());
+ origSandboxRoot = curSandboxRoot;
+ }
+ }
+ }
+ return ret;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1TargetWizard.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1TargetWizard.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1TargetWizard.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,320 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Carolina Nogueira de Souza (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1.ui.wizard;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.*;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.*;
+import org.maemo.esbox.internal.api.scratchbox.ui.wizards.*;
+import org.maemo.esbox.internal.scratchbox.sb1.Activator;
+import org.maemo.esbox.internal.scratchbox.sb1.core.Scratchbox1SDK;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.ErrorLogger;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.internal.api.maemosdk.ui.wizards.sbrsh.SbrshConfigurationNFSServer;
+import org.maemo.mica.internal.api.maemosdk.ui.wizards.sbrsh.SbrshConfigurationTargetDevice;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+/**
+ * The target wizard provides a easy way to create a target for Scratchbox. As
+ * Scratchbox target configuration, the user can configure your target.
+ *
+ */
+public class NewScratchbox1TargetWizard extends Wizard implements INewWizard {
+
+ protected WizardPage targetNamePage;
+ protected WizardPage compilerNamePage;
+ protected WizardPage devkitsName;
+ protected WizardPage cpuMethodName;
+ protected WizardPage sbrshConfigTargetDevice;
+ protected WizardPage sbrshConfigNFSServer;
+ protected IProject generatedProject;
+
+ private Scratchbox1SDK sdk;
+
+ protected ISDKTarget createdTarget;
+
+ private void initialize() {
+ setNeedsProgressMonitor(true);
+ setWindowTitle("New Scratchbox 1 Target");
+ ImageDescriptor image = Activator
+ .getImageDescriptor("./icons/full/wizban/newtarget_wiz.gif");
+ setDefaultPageImageDescriptor(image);
+ initPages();
+ }
+
+ /**
+ * Constructs a new target wizard for the given SDK (from the target
+ * configuration page)
+ *
+ * @param sdk
+ */
+ public NewScratchbox1TargetWizard(Scratchbox1SDK sdk) {
+ super();
+ this.sdk = sdk;
+ initialize();
+ }
+
+ /**
+ * Inicializes the content of the pages.
+ */
+ private void initPages() {
+ if (sdk != null) {
+ targetNamePage = TargetWizardPageFactory.getInstance()
+ .createNamePage(sdk);
+ addPage(targetNamePage);
+ compilerNamePage = TargetWizardPageFactory.getInstance()
+ .createCompilerPage(sdk);
+ addPage(compilerNamePage);
+ devkitsName = new TargetWizardDevkitsPage(sdk);
+ addPage(devkitsName);
+ cpuMethodName = TargetWizardPageFactory.getInstance()
+ .createCPUMethod(sdk);
+ addPage(cpuMethodName);
+ sbrshConfigTargetDevice = TargetWizardPageFactory.getInstance()
+ .createSbrshConfigDeviceTargetPage();
+ addPage(sbrshConfigTargetDevice);
+ sbrshConfigNFSServer = TargetWizardPageFactory.getInstance()
+ .createSbrshConfigNFSSServer();
+ addPage(sbrshConfigNFSServer);
+ } else {
+ addPage(TargetWizardPageFactory.getInstance()
+ .createBadInstallationPage());
+ }
+ }
+
+ public boolean canFinish() {
+ if (sdk == null)
+ return false;
+
+ boolean nonCustomRootstrap = true;
+ boolean cpuPage = ((TargetWizardCPUMethod) cpuMethodName).canFinish();
+ boolean configDevice = ((SbrshConfigurationTargetDevice) sbrshConfigTargetDevice)
+ .canFinish();
+ boolean NFSServer = ((SbrshConfigurationNFSServer) sbrshConfigNFSServer)
+ .canFinish();
+ boolean sbrshConfigAccepted = ((TargetWizardCPUMethod) cpuMethodName)
+ .getSbrshConfigure();
+
+ if (!sbrshConfigAccepted && (nonCustomRootstrap || cpuPage))
+ return true;
+ if (sbrshConfigAccepted && NFSServer && configDevice)
+ return true;
+
+ return false;
+ }
+
+ @Override
+ public IWizardPage getNextPage(IWizardPage page) {
+ if (page == cpuMethodName) {
+ boolean sbrshConfigAccepted = ((TargetWizardCPUMethod) cpuMethodName)
+ .getSbrshConfigure();
+ if (!sbrshConfigAccepted) // user does not want to configure sbrsh
+ return null;
+ else
+ // user wants to configure sbrsh
+ return super.getNextPage(page);
+ }
+ return super.getNextPage(page);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.IWizard#performFinish()
+ */
+ public boolean performFinish() {
+ if (!setupTargetFromScratch())
+ return false;
+
+ boolean sbrshConfigSelected = ((TargetWizardCPUMethod) cpuMethodName)
+ .getSbrshConfigure();
+ if (sbrshConfigSelected) {
+ configureSbrshService();
+ showsDialog();
+ }
+
+ return true;
+ }
+
+ private boolean setupTargetFromScratch() {
+ String targetName;
+ // in this mode, construct a target from the user's settings
+ targetName = getTargetNameSelected();
+ String compilerName = getCompilerNameSelected();
+ String cpuMethod = getCputranspSelected();
+ try {
+
+ String devkits = getDevkitsSelected();
+ // ScratchboxFacade.getInstance().createTarget((IScratchbox1SDK)
+ // sdk, targetName, compilerName, devkits, cpuMethod);
+ sdk.createTarget(targetName, compilerName, devkits, cpuMethod);
+
+ createdTarget = sdk.findSDKTarget(targetName);
+ return true;
+ } catch (ESboxException e) {
+ ErrorLogger errorLogger = Activator.getErrorLogger();
+ errorLogger.logAndShowError("Cannot get create target "
+ + targetName, e);
+ return false;
+ }
+ }
+
+ /**
+ * Return the name of the target to be created.
+ *
+ * @return the name of the target to be created.
+ */
+ private String getTargetNameSelected() {
+ return ((TargetWizardNamePage) targetNamePage).getTextControl()
+ .getText();
+ }
+
+ /**
+ * Return the compiler name of the target to be created.
+ *
+ * @return the compiler name of the target to be created.
+ */
+ private String getCompilerNameSelected() {
+ TableItem item = ((TargetWizardCompilerPage) compilerNamePage)
+ .getTableControl().getSelection()[0];
+ return item.getText();
+ }
+
+ /**
+ * Return the devkits selected.
+ *
+ * @return the devkits selected.
+ */
+ private String getDevkitsSelected() {
+ String devkits = "";
+ TableItem devkitsSelected[] = ((TargetWizardDevkitsPage) devkitsName).table
+ .getSelection();
+ String separator = "";
+ for (int i = 0; i < devkitsSelected.length; i++) {
+ TableItem devkit = devkitsSelected[i];
+ devkits += separator + devkit.getText();
+ separator = ":";
+ }
+ return devkits;
+ }
+
+ /**
+ * Return the cputransp name of the target to be created.
+ *
+ * @return the cputransp name of the target to be created.
+ */
+ private String getCputranspSelected() {
+ TableItem item = ((TargetWizardCPUMethod) cpuMethodName).getTable()
+ .getSelection()[0];
+ return item.getText();
+ }
+
+ /**
+ * Configure sbrsh service.
+ */
+ private void configureSbrshService() {
+ String targetName = getTargetNameSelected();
+ String deviceTargetAddr = ((SbrshConfigurationTargetDevice) sbrshConfigTargetDevice)
+ .getTargetDeviceAddr();
+ String nfsHostname = ((SbrshConfigurationNFSServer) sbrshConfigNFSServer)
+ .getNFSHostname();
+
+ try {
+ // ScratchboxFacade.getInstance().configureSbrsh(sdk, targetName,
+ // deviceTargetAddr, nfsHostname);
+ sdk.configureSbrsh(targetName, deviceTargetAddr, nfsHostname);
+ } catch (ESboxException e) {
+ ErrorLogger errorLogger = Activator.getErrorLogger();
+ errorLogger.logAndShowError("Cannot configure sbrsh", e);
+ }
+ }
+
+ /**
+ * Add user at access list of the sbrshd running at the target device.
+ */
+ private void addUser() {
+ String deviceTargetIP = ((SbrshConfigurationTargetDevice) sbrshConfigTargetDevice)
+ .getTargetDeviceIP();
+ String username = System.getProperty("user.name");
+ ErrorLogger errorLogger = Activator.getErrorLogger();
+
+ try {
+ String localAddr = getLocalIP();
+ // ScratchboxFacade.getInstance().addSbrshAccessList(sdk,
+ // deviceTargetIP, username, localAddr);
+ sdk.addSbrshAccessList(deviceTargetIP, username, localAddr);
+ } catch (ESboxException e) {
+ errorLogger
+ .logAndShowError(
+ "Cannot add user to the access list of sbrshd at the target device",
+ e);
+ } catch (UnknownHostException e) {
+ errorLogger.logAndShowError("Cannot get local IP address", e);
+ }
+ }
+
+ /**
+ * Shows the dialog to ask the user if s/he wants to add his/herself to the
+ * acess list of the sbrshd.
+ */
+ private void showsDialog() {
+ String deviceTargetAddr = ((SbrshConfigurationTargetDevice) sbrshConfigTargetDevice)
+ .getTargetDeviceIP();
+ String text = "Do you want to add yourself to the access list of the sbrshd running on target device? \n";
+ text += "(This requires that "
+ + deviceTargetAddr
+ + " has ssh daemon running and sbrshd already installed, and that you have root access).";
+ boolean userAddedAtAccessList = MessageDialog.openQuestion(getShell(),
+ "Scratchbox Configuration", text);
+ if (userAddedAtAccessList) {
+ addUser();
+ }
+ }
+
+ /**
+ * Get the local IP address.
+ *
+ * @return the local IP address.
+ * @throws UnknownHostException
+ */
+ private String getLocalIP() throws UnknownHostException {
+ return InetAddress.getLocalHost().getHostAddress();
+ }
+
+ /**
+ * We will accept the selection in the workbench to see if we can initialize
+ * from it.
+ *
+ * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ }
+
+ /**
+ * Get the target created. Only valid after wizard dialog completes.
+ *
+ * @return newly created ISDKTarget or <code>null</code>
+ */
+ public ISDKTarget getCreatedTarget() {
+ return createdTarget;
+ }
+
+}
\ No newline at end of file
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/TargetWizardDevkitsPage.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/TargetWizardDevkitsPage.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/TargetWizardDevkitsPage.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Carolina Nogueira de Souza (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.scratchbox.sb1.ui.wizard;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.*;
+import org.maemo.esbox.internal.scratchbox.sb1.Activator;
+import org.maemo.esbox.internal.scratchbox.sb1.core.Scratchbox1SDK;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.ErrorLogger;
+import org.maemo.mica.internal.api.maemosdk.ui.wizards.IValidatePage;
+
+import java.util.List;
+
+/**
+ * This pages shows the devkits that the user can choose for his/her target.
+ *
+ */
+public class TargetWizardDevkitsPage extends WizardPage implements
+ IValidatePage {
+
+ protected Table table;
+ private Scratchbox1SDK sdk;
+
+ /**
+ * Constructs a NewTargetWizardDevkitsPage.
+ */
+ protected TargetWizardDevkitsPage(Scratchbox1SDK sdk) {
+ super("Devkit");
+ this.sdk = sdk;
+ setTitle("Devkit");
+ setDescription("Select devkits");
+ setPageComplete(false);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
+ * .Composite)
+ */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(1, false));
+
+ Label label = new Label(composite, SWT.LEFT);
+ label.setText("Devkits");
+
+ table = new Table(composite, SWT.MULTI | SWT.CHECK | SWT.BORDER);
+ table.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
+ table.setHeaderVisible(false);
+ table.setLinesVisible(true);
+ table.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ validatePage();
+ }
+ });
+
+ inicializeTable();
+
+ setControl(composite);
+ }
+
+ /**
+ * Inicializes the contents of the table.
+ */
+ private void inicializeTable() {
+ TableItem item = null;
+ List<String> devkits = null;
+ try {
+ // devkits = ScratchboxFacade.getInstance().getDevkits(sdk);
+ devkits = sdk.getDevkits();
+ } catch (ESboxException e) {
+ ErrorLogger errorLogger = Activator.getErrorLogger();
+ errorLogger.logAndShowError("Cannot get list of devkits", e);
+ return;
+ }
+ for (String devkit : devkits) {
+ item = new TableItem(table, SWT.NONE);
+ item.setText(devkit);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * br.edu.ufcg.dee.omapsdk.properties.target.wizard.pages.ValidateWizardPage
+ * #perfomeAction()
+ */
+ public boolean validatePage() {
+ TableItem[] items = table.getItems();
+ boolean noneSelected = false;
+ boolean pageOK = false;
+ // verifies if at least one option was checked.
+ for (int i = 0; i < items.length; i++) {
+ TableItem item = items[i];
+ if (item.getChecked()) {
+ pageOK = true;
+ break;
+ }
+ }
+ // verifies if the options were choosen properly.
+ for (int i = 0; i < items.length; i++) {
+ TableItem item = items[i];
+ // verifies if any item was selected.
+ if (item.getChecked()) {
+ // verifies if "none" was selected.
+ if (item.getText().equals("none")) {
+ noneSelected = true;
+ // the user cant select another devkit if "none" was
+ // selected.
+ } else {
+ pageOK = !noneSelected;
+ }
+ }
+ }
+ if (noneSelected && !pageOK) {
+ setErrorMessage("Selected corrects devkits.");
+ } else {
+ String msg = pageOK ? null : "Select at least one option";
+ setErrorMessage(msg);
+ }
+ setPageComplete(pageOK);
+ return pageOK;
+ }
+}
\ No newline at end of file
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/sb1/sdk/IScratchbox1SDK.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/sb1/sdk/IScratchbox1SDK.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/sb1/sdk/IScratchbox1SDK.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Petr Baranov (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.sb1.sdk;
+
+import java.util.List;
+
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDK;
+import org.maemo.mica.common.core.ESboxException;
+
+/**
+ * @author baranov
+ *
+ */
+public interface IScratchbox1SDK extends IScratchboxSDK {
+ public static final String NAME = "Scratchbox 1";
+
+ /**
+ * Return the list of available devkits at Scratchbox.
+ *
+ * @return a list with the available devkits at Scratchbox.
+ * @throws ESboxException
+ * if some problem related to Scratchbox communication occurs.
+ */
+ public List<String> getDevkits() throws ESboxException;
+
+ /**
+ * Return the current sessions of Scratchbox.
+ *
+ * @return a list with current sessions Scratchbox.
+ * @throws ESboxException
+ * if some problem related to Scratchbox communication occurs.
+ */
+ public List<String> getSessions() throws ESboxException;
+
+ /**
+ * Select another available target as current Scratchbox target.
+ *
+ * @param targetName
+ * the name of the new target.
+ * @return true, if the operation is performed successfully.
+ * @throws ESboxException
+ * if the target to be selected does not exists or if some
+ * problem related to Scratchbox communication occurs.
+ */
+ public boolean selectTarget(String targetName) throws ESboxException;
+
+ /**
+ * Kill an Scratchbox process.
+ *
+ * @return true, if the is performed successfully.
+ * @throws ESboxException
+ * if some problem related to Scratchbox communication occurs.
+ */
+ public boolean killProcess() throws ESboxException;
+
+ /**
+ * Kill an Scratchbox process.
+ *
+ * @param signal
+ * the signal emitted to scratchbox processes.
+ * @return true, if the is performed successfully.
+ * @throws ESboxException
+ * if some problem related to Scratchbox communication occurs.
+ */
+ public boolean killProcess(String signal) throws ESboxException;
+}
Property changes on: branches/micaSplit/org.maemo.esbox.scratchbox.sb2
___________________________________________________________________
Name: svn:ignore
+ bin
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/.classpath
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/.classpath (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/.classpath 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/.project
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/.project (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/.project 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.maemo.esbox.scratchbox.sb2</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/META-INF/MANIFEST.MF
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/META-INF/MANIFEST.MF (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/META-INF/MANIFEST.MF 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ESbox Scratchbox 2 Support
+Bundle-SymbolicName: org.maemo.esbox.scratchbox.sb2;singleton:=true
+Bundle-Version: 2.0.0.qualifier
+Bundle-Activator: org.maemo.esbox.internal.scratchbox.sb2.Activator
+Require-Bundle: org.eclipse.core.runtime,
+ org.maemo.mica.maemosdk.core;bundle-version="2.0.0";visibility:=reexport,
+ org.eclipse.ui.ide,
+ org.maemo.mica.maemosdk.ui;bundle-version="2.0.0",
+ org.maemo.esbox.scratchbox.core;bundle-version="2.0.0",
+ org.maemo.esbox.scratchbox.ui;bundle-version="2.0.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.maemo.esbox.internal.api.scratchbox.sb2.core,
+ org.maemo.esbox.internal.scratchbox.sb2.command;x-friends:="org.maemo.esbox.scratchbox.tests",
+ org.maemo.esbox.internal.scratchbox.sb2.core;x-friends:="org.maemo.esbox.scratchbox.tests",
+ org.maemo.esbox.internal.scratchbox.sb2.provider;x-friends:="org.maemo.esbox.scratchbox.tests",
+ org.maemo.esbox.scratchbox.sb2.sdk
+Bundle-Vendor: INdT / Nokia
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/build.properties
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/build.properties (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/build.properties 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ conf/,\
+ icons/
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/conf/sb2_prefs.xml
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/conf/sb2_prefs.xml (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/conf/sb2_prefs.xml 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>This file contains the default settings for Scratchbox 2 preferences;
+ see the org.maemo.mica.common.core.preference_set_provider extension</comment>
+
+ <!-- WHEN ANY DEFAULTS CHANGED warranting rewriting prefs,
+ bump pref version in esbox_common.xml and adjust ESboxPreferenceInitializer#RPEFS_VERSION_MAJOR ;
+ WHEN ANYTHING ELSE CHANGED which can be merged into existing prefs,
+ adjust ESboxPreferenceInitializer#RPEFS_VERSION_MINOR -->
+
+ <entry key="SB2_MAPPING_MODE">maemo</entry>
+ <entry key="SB2_INSTALL_MAPPING_MODE">emulate</entry>
+ <entry key="SB2_LOG_LEVEL"></entry>
+
+ <entry key="SB2_EXEC_COMMAND">sb2 -Qx -m ${MAPPING_MODE} ${LOG_OPTION} -t ${TARGET} "${{COMMAND}} ${{ARGS}}"</entry>
+
+ <!-- this qemu-arm link is expected to be valid; we don't try to substitute unlike for sb1: see GetGdbQemuCommandPatternCommand -->
+ <entry key="SB2_GDB_REMOTE_QEMU">sb2-qemu-arm -g ${PORT}</entry>
+
+ <!-- The hash-bang in these scripts don't properly launch bash! -->
+ <entry key="SB2_INIT_COMMAND">/bin/bash -c "sb2-init ${{OPTIONS}} ${{TARGET}} ${{COMPILER}}"</entry>
+ <entry key="SB2_CONFIG_COMMAND">/bin/bash -c "sb2-config ${{ACTIONS}} ${{OPTIONS}}"</entry>
+ <entry key="SB2_MAEMO_ROOTSTRAP_COMMAND">/bin/bash -c "maemo-rootstrap ${{OPTIONS}}"</entry>
+ <entry key="SB2_SB2_SHOW_COMMAND">sb2-show</entry>
+
+ <!-- actions of command sb2-config -->
+
+ <entry key="SB2_VERSION_ACT">-v</entry>
+ <entry key="SB2_LIST_ACT">-l</entry>
+
+ <!-- actions of command maemo-rootstrap -->
+ <entry key="SB2_MAEMO_ROOTSTRAP_HOST_TOOLS_OPT">--host-tools</entry>
+ <entry key="SB2_MAEMO_ROOTSTRAP_FORCE_OPT">--force</entry>
+ <entry key="SB2_MAEMO_ROOTSTRAP_AVAILABLE_ACT">available</entry>
+ <entry key="SB2_MAEMO_ROOTSTRAP_LIST_ACT">list</entry>
+ <entry key="SB2_MAEMO_ROOTSTRAP_INSTALL_ACT">install</entry>
+ <entry key="SB2_MAEMO_ROOTSTRAP_REMOVE_ACT">remove</entry>
+ <entry key="SB2_MAEMO_ROOTSTRAP_PATH_ACT">path</entry>
+
+ <!-- actions of command sb2-show -->
+ <entry key="SB2_SB2_SHOW_PATH_ACTION">path</entry>
+ <entry key="SB2_SB2_SHOW_PATH_OUTPUT_PATTERN">(.+)\s+=>\s+(\S+).*</entry>
+
+</properties>
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/icons/full/obj16/maemoprj_obj.png
===================================================================
(Binary files differ)
Property changes on: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/icons/full/obj16/maemoprj_obj.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/plugin.xml
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/plugin.xml (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/plugin.xml 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.maemo.mica.common.core.sdk_provider">
+ <sdk_provider
+ class="org.maemo.esbox.internal.scratchbox.sb2.provider.Scratchbox2SDKProvider">
+ </sdk_provider>
+ </extension>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.maemo.mica.common.ui.preferenceCategory.maemo"
+ class="org.maemo.esbox.internal.scratchbox.sb2.ui.preferences.Scratchbox2PreferencesPage"
+ id="org.maemo.mica.maemosdk.sb2.preferencePage.sb2"
+ name="Scratchbox 2">
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.adapters">
+ <factory
+ adaptableType="org.maemo.esbox.scratchbox.sb2.sdk.IScratchbox2SDK"
+ class="org.maemo.esbox.internal.scratchbox.sb2.ui.adapters.MaemoScratchbox2SDKManageTargetAdapterFactory">
+ <adapter
+ type="org.maemo.mica.common.core.adapters.ISDKManageTargetAdapter">
+ </adapter>
+ </factory>
+ </extension>
+ <extension
+ point="org.maemo.mica.common.core.preference_set_provider">
+ <preferenceSetProvider
+ defaultsXMLFile="conf/sb2_prefs.xml"
+ preferenceConstantsClass="org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants"
+ preferenceMigratorClass="org.maemo.mica.internal.api.common.core.OldESboxPreferenceMigrator"
+ preferenceStoreBundle="org.maemo.esbox.scratchbox.sb2"
+ version="17">
+ </preferenceSetProvider>
+ </extension>
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <wizard
+ class="org.maemo.esbox.internal.scratchbox.sb2.ui.wizard.NewScratchbox2TargetWizard"
+ icon="icons/full/obj16/maemoprj_obj.png"
+ id="org.maemo.mica.maemosdk.ui.scratchbox.targets.wizards.NewTargetWizard"
+ name="Scratchbox Targets">
+ </wizard>
+ </extension>
+
+</plugin>
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/api/scratchbox/sb2/core/SB2PreferenceConstants.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/api/scratchbox/sb2/core/SB2PreferenceConstants.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/api/scratchbox/sb2/core/SB2PreferenceConstants.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.api.scratchbox.sb2.core;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.maemo.esbox.internal.scratchbox.sb2.Activator;
+
+/**
+ * This class encapsulates the keys for preference constants defined by
+ * Scratchbox 2.
+ *
+ * @author eswartz
+ *
+ */
+public class SB2PreferenceConstants {
+ public static final int VERSION_MAJOR = 17;
+ public static final int VERSION_MINOR = 0;
+
+ /** Get the preference store that contains these preferences */
+ public static IPreferenceStore getPreferenceStore() {
+ return Activator.getDefault().getPreferenceStore();
+ }
+
+ /* SB2 configuration options */
+ public static final String SB2_GDB_REMOTE_QEMU = "SB2_GDB_REMOTE_QEMU";
+ public static final String SB2_CONFIG_COMMAND = "SB2_CONFIG_COMMAND";
+ public static final String SB2_EXEC_COMMAND = "SB2_EXEC_COMMAND";
+ public static final String SB2_INIT_COMMAND = "SB2_INIT_COMMAND";
+ public static final String SB2_VERSION_ACT = "SB2_VERSION_ACT";
+ public static final String SB2_LIST_ACT = "SB2_LIST_ACT";
+ public static final String SB2_MAPPING_MODE = "SB2_MAPPING_MODE";
+ public static final String SB2_INSTALL_MAPPING_MODE = "SB2_INSTALL_MAPPING_MODE";
+ public static final String SB2_LOG_LEVEL = "SB2_LOG_LEVEL";
+ public static final String SB2_INIT_OPT_COMPILER = "SB2_INIT_OPT_COMPILER";
+ public static final String SB2_MAEMO_ROOTSTRAP_COMMAND = "SB2_MAEMO_ROOTSTRAP_COMMAND";
+ public static final String SB2_MAEMO_ROOTSTRAP_AVAILABLE_ACT = "SB2_MAEMO_ROOTSTRAP_AVAILABLE_ACT";
+ public static final String SB2_MAEMO_ROOTSTRAP_LIST_ACT = "SB2_MAEMO_ROOTSTRAP_LIST_ACT";
+ public static final String SB2_MAEMO_ROOTSTRAP_INSTALL_ACT = "SB2_MAEMO_ROOTSTRAP_INSTALL_ACT";
+ public static final String SB2_MAEMO_ROOTSTRAP_FORCE_OPT = "SB2_MAEMO_ROOTSTRAP_FORCE_OPT";
+ public static final String SB2_MAEMO_ROOTSTRAP_HOST_TOOLS_OPT = "SB2_MAEMO_ROOTSTRAP_HOST_TOOLS_OPT";
+ public static final String SB2_MAEMO_ROOTSTRAP_REMOVE_ACT = "SB2_MAEMO_ROOTSTRAP_REMOVE_ACT";
+ public static final String SB2_SB2_SHOW_COMMAND = "SB2_SB2_SHOW_COMMAND";
+ public static final String SB2_SB2_SHOW_PATH_ACTION = "SB2_SB2_SHOW_PATH_ACTION";
+ public static final String SB2_SB2_SHOW_PATH_OUTPUT_PATTERN = "SB2_SB2_SHOW_PATH_OUTPUT_PATTERN";
+ public static final String SB2_MAEMO_ROOTSTRAP_PATH_ACT = "SB2_MAEMO_ROOTSTRAP_PATH_ACT";
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/Activator.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/Activator.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/Activator.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,157 @@
+package org.maemo.esbox.internal.scratchbox.sb2;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import org.maemo.mica.common.core.ErrorLogger;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.maemo.mica.maemosdk.sdk2";
+
+ // The shared instance
+ private static Activator plugin;
+
+ private IPreferenceStore preferenceStore;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Return the error logger instance of this plug-in.
+ *
+ * @return the error logger instance of this plug-in.
+ */
+ public static ErrorLogger getErrorLogger() {
+ class CoreErrorLogger extends ErrorLogger {
+
+ @Override
+ public String getPluginID() {
+ return PLUGIN_ID;
+ }
+
+ @Override
+ public Plugin getPlugin() {
+ return Activator.getDefault();
+ }
+
+ }
+
+ return new CoreErrorLogger();
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given plug-in
+ * relative path.
+ *
+ * @param path
+ * the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ /**
+ * Find a file relative to the plugin, either in a running workspace or a
+ * standalone unit test (assumed to run relative to a plugin)
+ *
+ * @param path
+ */
+ public static InputStream getPluginRelativeInputStream(String path)
+ throws IOException {
+ if (getDefault() != null) {
+ return FileLocator.openStream(getDefault().getBundle(), new Path(
+ path), false);
+ } else {
+ return new FileInputStream("../" + path);
+ }
+ }
+
+ /**
+ * Returns the preference store for this UI plug-in. This preference store
+ * is used to hold persistent settings for this plug-in in the context of a
+ * workbench. Some of these settings will be user controlled, whereas others
+ * may be internal setting that are never exposed to the user.
+ * <p>
+ * If an error occurs reading the preference store, an empty preference
+ * store is quietly created, initialized with defaults, and returned.
+ * </p>
+ * <p>
+ * <strong>NOTE:</strong> As of Eclipse 3.1 this method is no longer
+ * referring to the core runtime compatibility layer and so plug-ins relying
+ * on Plugin#initializeDefaultPreferences will have to access the
+ * compatibility layer themselves.
+ * </p>
+ *
+ * @return the preference store
+ */
+ public IPreferenceStore getPreferenceStore() {
+ // Create the preference store lazily.
+ if (preferenceStore == null) {
+ preferenceStore = new ScopedPreferenceStore(new InstanceScope(),
+ getBundle().getSymbolicName());
+
+ }
+ return preferenceStore;
+ }
+
+ /**
+ * @param object
+ * @param e
+ * @return
+ */
+ public static IStatus createErrorStatus(String msg, Throwable t) {
+ return new Status(IStatus.ERROR, PLUGIN_ID, msg, t);
+ }
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/AbstractSb2Command.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/AbstractSb2Command.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/AbstractSb2Command.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Petr Baranov (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.command;
+
+import org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.AbstractSDKCommand;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.security.InvalidParameterException;
+
+public abstract class AbstractSb2Command extends AbstractSDKCommand {
+
+ public AbstractSb2Command(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.maemo.esbox.maemosdk.core.command.AbstractSDKCommand#
+ * replaceScratchboxConfigCommand(java.lang.String, java.lang.String[])
+ */
+ public String replaceScratchboxConfigCommand(String action, String[] options)
+ throws InvalidParameterException {
+ String sboxCommand;
+
+ sboxCommand = commandAbstractor
+ .getPreferenceValue(SB2PreferenceConstants.SB2_CONFIG_COMMAND);
+
+ return replaceScratchboxCommand(sboxCommand, action, options);
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/CreateMaemoRootstrapSb2Command.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/CreateMaemoRootstrapSb2Command.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/CreateMaemoRootstrapSb2Command.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.command;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.CorePlugin;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.env.IEnvironmentModifierBlock;
+import org.maemo.mica.common.core.process.ProcessLauncherUtils;
+import org.maemo.mica.common.core.sdk.ISDK;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Creates a new rootstrap for a target, if it does not exist. This command
+ * wraps the callback to service:
+ * <p>
+ * maemo-rootstrap [--force] install <target>
+ *
+ */
+public class CreateMaemoRootstrapSb2Command extends MaemoRootstrapSb2Command {
+
+ private ISDK sdk;
+ private IProgressMonitor monitor;
+
+ public CreateMaemoRootstrapSb2Command(ISDK sdk,
+ ICommandAbstractor commandAbstractor, IProgressMonitor monitor) {
+ super(commandAbstractor);
+ this.sdk = sdk;
+ this.monitor = monitor;
+ }
+
+ protected boolean checkParameters(List<String> param) {
+ return param.size() == 3;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public Boolean performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String targetName = param.get(0);
+ String useHostToolsFlag = param.get(1);
+ String forceFlag = param.get(2);
+
+ List<String> params = new ArrayList<String>();
+ if (useHostToolsFlag.equals(Boolean.TRUE.toString())) {
+ params
+ .add(commandAbstractor
+ .getPreferenceValue(SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_HOST_TOOLS_OPT));
+ }
+ if (forceFlag.equals(Boolean.TRUE.toString())) {
+ params
+ .add(commandAbstractor
+ .getPreferenceValue(SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_FORCE_OPT));
+ }
+ params
+ .add(commandAbstractor
+ .getPreferenceValue(SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_INSTALL_ACT));
+ params.add(targetName);
+
+ IEnvironmentModifierBlock envBlock = commandAbstractor
+ .getProcessLauncherFactory().defaultEnvironmentModifierBlock();
+ ProcessLauncherUtils.defineProxyVariables(envBlock);
+
+ setMonitorAndConsole(monitor, CorePlugin.getDefault().getConsole(true,
+ null, "Installing rootstrap " + targetName));
+ doPerformCommand(params, envBlock, 0);
+
+ sdk.refresh();
+
+ return true;
+ }
+
+ public int getParametersSize() {
+ return 1;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/CreateTargetSb2Command.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/CreateTargetSb2Command.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/CreateTargetSb2Command.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.command;
+
+import org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants;
+import org.maemo.esbox.internal.scratchbox.sb2.Activator;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.process.*;
+import org.maemo.mica.common.core.sdk.ISDK;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.List;
+
+/**
+ * Creates a new target, if it does not exist. This command wraps the callback
+ * to service:
+ * <p>
+ * sb2-init {flags} [targetname] [compiler]
+ *
+ */
+public class CreateTargetSb2Command extends AbstractSb2Command {
+
+ private ISDK sdk;
+
+ public CreateTargetSb2Command(ISDK sdk, ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ this.sdk = sdk;
+ }
+
+ @Override
+ protected boolean checkParameters(List<String> param) {
+ return param.size() >= 3;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public Object performCommand(List<String> param) throws ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String targetName = param.get(0);
+ String compilerName = param.get(1);
+ String cpuTransp = param.get(2);
+
+ // remaining arguments are flags
+ String pattern = commandAbstractor
+ .getPreferenceValue(SB2PreferenceConstants.SB2_INIT_COMMAND);
+
+ ShellTemplateSubstitutor substitutor = new ShellTemplateSubstitutor();
+ substitutor.define("TARGET", targetName);
+ substitutor.define("COMPILER", compilerName);
+
+ String options = "";
+ if (cpuTransp != null && cpuTransp.length() > 0) {
+ options += "-c " + cpuTransp;
+ }
+ substitutor.define("OPTIONS", options);
+
+ pattern = substitutor.substitute(pattern);
+
+ List<String> cmdLine = CommandLineArguments
+ .createFromCommandLine(pattern);
+
+ IProcessLauncher processLauncher = ProcessLauncherCreator
+ .createProcessLauncher(commandAbstractor
+ .getProcessLauncherFactory(), null, cmdLine);
+
+ Process process = processLauncher.createProcess();
+
+ processLauncher.redirectToConsole(true, null,
+ "Installing scratchbox2 target " + targetName);
+
+ try {
+ process.waitFor();
+ } catch (InterruptedException e) {
+ Activator.getErrorLogger().logError("Target installation aborted",
+ e);
+ }
+
+ sdk.refresh();
+
+ return true;
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 3;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/GetCurrentTargetSb2Command.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/GetCurrentTargetSb2Command.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/GetCurrentTargetSb2Command.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.command;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.*;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.io.*;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Get the current Scratchgox 2 target. There is no command to do this, so read
+ * $HOME/.scratchbox2/config
+ */
+public class GetCurrentTargetSb2Command extends AbstractSb2Command {
+
+ public GetCurrentTargetSb2Command(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public String performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ IFileStore config = commandAbstractor
+ .getFileSystemAccess()
+ .getFileStore(
+ new Path("home")
+ .append(
+ commandAbstractor
+ .getPreferenceValue(CorePreferenceConstants.USER))
+ .append(".scratchbox2").append("config"));
+
+ InputStream is = null;
+ try {
+ is = config.openInputStream(EFS.NONE, null);
+ BufferedReader reader = new BufferedReader(
+ new InputStreamReader(is));
+ Pattern varPattern = Pattern
+ .compile("\\s*DEFAULT_TARGET\\s*=\\s*(\\S+)\\s*");
+ String line;
+ while ((line = reader.readLine()) != null) {
+ Matcher matcher = varPattern.matcher(line.trim());
+ if (matcher.matches()) {
+ return matcher.group(1);
+ }
+ }
+
+ return null;
+ } catch (IOException e) {
+ throw new ScratchboxException("Cannot read target from " + config
+ + ": " + e.getMessage());
+ } catch (CoreException e) {
+ throw new ScratchboxException("Cannot read target from " + config
+ + ": " + e.getMessage());
+ } finally {
+ Policy.close(is);
+ }
+
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 0;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/GetGdbQemuCommandPatternCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/GetGdbQemuCommandPatternCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/GetGdbQemuCommandPatternCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.command;
+
+import org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.SBPreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.List;
+
+/**
+ * Get the command pattern for launching qemu with the debugger
+ *
+ * @author eswartz
+ *
+ */
+public class GetGdbQemuCommandPatternCommand extends AbstractSb2Command {
+ private IScratchboxSDKTarget sdkTarget;
+
+ public GetGdbQemuCommandPatternCommand(IScratchboxSDKTarget sdkTarget,
+ ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ this.sdkTarget = sdkTarget;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public String performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String commandPattern = null;
+
+ String architecture = param.get(0);
+
+ if (architecture.equals(IScratchboxSDKTarget.ARCHITECTURE_ARMEL)) {
+ // we think this always uses a new enough version, so keep ${PORT}
+ commandPattern = sdkTarget
+ .getPreferenceValue(SB2PreferenceConstants.SB2_GDB_REMOTE_QEMU);
+ } else {
+ // The others, just standard "gdbserver" command.
+ commandPattern = sdkTarget
+ .getPreferenceValue(SBPreferenceConstants.SBOX_GDB_REMOTE);
+ }
+
+ return commandPattern;
+ }
+
+ /**
+ * Find what qemu is configured for this target.
+ *
+ * @return qemu name, or <code>null</code> if not using qemu
+ */
+ protected String getConfiguredQemu() throws ESboxException {
+ return null;
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 1;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/GetMaemoRootstrapLocationCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/GetMaemoRootstrapLocationCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/GetMaemoRootstrapLocationCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.scratchbox.sb2.command;
+
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author eswartz
+ *
+ */
+public class GetMaemoRootstrapLocationCommand extends MaemoRootstrapSb2Command {
+
+ private IScratchboxSDKTarget sdkTarget;
+
+ public GetMaemoRootstrapLocationCommand(
+ ICommandAbstractor commandAbstractor, IScratchboxSDKTarget sdkTarget) {
+ super(commandAbstractor);
+ this.sdkTarget = sdkTarget;
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 0;
+ }
+
+ @Override
+ protected boolean checkParameters(List<String> param) {
+ return param.size() == 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.internal.common.core.command.ICommand#performCommand(java.util
+ * .List)
+ */
+ public Object performCommand(List<String> params)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(params))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ List<String> rsCommands = new ArrayList<String>(2);
+
+ String pathAction = commandAbstractor
+ .getPreferenceValue(SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_PATH_ACT);
+
+ rsCommands.add(pathAction);
+ rsCommands.add(sdkTarget.getName());
+
+ List<String> results = doPerformCommand(rsCommands, null, 0);
+ if (results.size() == 0)
+ throw new ScratchboxException(
+ "Could not detect rootstrap location for " + sdkTarget
+ + "\ngot:\n" + catenateLines(results));
+
+ // ignore bogus report of deleted rootstrap
+ IPath root = new Path(results.get(0).trim());
+ IFileStore store = sdkTarget.getMachineFileSystemAccess().getFileStore(
+ root);
+ if (store.fetchInfo().exists())
+ return root;
+ else
+ throw new ScratchboxException("Rootstrap location for " + sdkTarget
+ + " does not exist: " + store);
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/GetVersionScratchboxCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/GetVersionScratchboxCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/GetVersionScratchboxCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.command;
+
+import org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.List;
+
+/**
+ * Get the version of Scratchbox installed. This command wraps the callback to
+ * service sb-conf version.
+ *
+ */
+public class GetVersionScratchboxCommand extends AbstractSb2Command {
+
+ public GetVersionScratchboxCommand(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.ScratchboxCommand#getParametersSize()
+ */
+ public int getParametersSize() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .util.List)
+ */
+ public String performCommand(List<String> params)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(params))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String sboxVersionAction = commandAbstractor
+ .getPreferenceValue(SB2PreferenceConstants.SB2_VERSION_ACT);
+
+ String currentSboxVersionCommand = this
+ .replaceScratchboxConfigCommand(sboxVersionAction);
+
+ Process process = createProcess(currentSboxVersionCommand, null);
+
+ String currentVersion = getInputFromProcessAndWait(process, false, 0);
+
+ return currentVersion;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListAvailableMaemoRootstrapsSb2Command.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListAvailableMaemoRootstrapsSb2Command.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListAvailableMaemoRootstrapsSb2Command.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.command;
+
+import org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.scratchbox.sb2.sdk.MaemoRootstrap;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.env.IEnvironmentModifierBlock;
+import org.maemo.mica.common.core.process.ProcessLauncherUtils;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.*;
+
+/**
+ * List the maemo rootstraps available for installation.
+ */
+public class ListAvailableMaemoRootstrapsSb2Command extends
+ MaemoRootstrapSb2Command {
+
+ private static final int LIST_TIMEOUT = 10000;
+
+ public ListAvailableMaemoRootstrapsSb2Command(
+ ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ @Override
+ protected boolean checkParameters(List<String> param) {
+ return param.size() == 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public List<MaemoRootstrap> performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String availableAction = commandAbstractor
+ .getPreferenceValue(SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_AVAILABLE_ACT);
+
+ // ensure the proxy is established
+ IEnvironmentModifierBlock proxyEnvBlock = commandAbstractor
+ .getProcessLauncherFactory().defaultEnvironmentModifierBlock();
+ ProcessLauncherUtils.defineProxyVariables(proxyEnvBlock);
+
+ List<String> available = doPerformCommand(Collections
+ .singletonList(availableAction), proxyEnvBlock, LIST_TIMEOUT);
+
+ // this output has a few header lines
+ List<MaemoRootstrap> targetsAvailable = new ArrayList<MaemoRootstrap>();
+
+ boolean gotHeader = false;
+ for (String line : available) {
+ if (line.contains("Nickname,")) {
+ gotHeader = true;
+ continue;
+ }
+ if (line.trim().length() == 0) {
+ continue;
+ }
+ if (!gotHeader) {
+ continue;
+ }
+
+ String[] tokens = line.split(",\\s*");
+ if (tokens.length == 3) {
+ targetsAvailable.add(new MaemoRootstrap(tokens[0], tokens[1],
+ tokens[2]));
+ }
+
+ }
+ return targetsAvailable;
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 0;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListCompilersSb2Command.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListCompilersSb2Command.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListCompilersSb2Command.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.command;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
+import org.maemo.esbox.internal.scratchbox.sb2.Activator;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * List the installed compilers. There's no known command for this, but we can
+ * look in specific places.
+ *
+ */
+public class ListCompilersSb2Command extends AbstractSb2Command {
+
+ public ListCompilersSb2Command(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public List<String> performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ List<String> compilersAvailable = new ArrayList<String>();
+
+ try {
+ IFileStore baseToolDir = commandAbstractor.getFileSystemAccess()
+ .getFileStore(new Path("/opt/maemo/tools"));
+ IFileStore[] kids = baseToolDir.childStores(EFS.NONE, null);
+ for (IFileStore baseDir : kids) {
+ IFileStore dir = baseDir.getChild("bin");
+ if (dir.fetchInfo().isDirectory()) {
+ IFileStore[] files = dir.childStores(EFS.NONE, null);
+ for (IFileStore file : files) {
+ if (file.getName().endsWith("-gcc")) {
+ compilersAvailable.add(file.toURI().getPath());
+ break;
+ }
+ }
+ }
+ }
+ } catch (CoreException e) {
+ Activator.getErrorLogger().logError("Error scanning compilers", e);
+ }
+ return compilersAvailable;
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 0;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListCputranspSb2Command.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListCputranspSb2Command.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListCputranspSb2Command.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.command;
+
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.runtime.Path;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.process.ProcessLauncherUtils;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.*;
+
+/**
+ * List the installed compilers. There's no known command for this, but we can
+ * look in specific places.
+ *
+ */
+public class ListCputranspSb2Command extends AbstractSb2Command {
+
+ public ListCputranspSb2Command(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public List<String> performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ List<String> cputranspAvailable = new ArrayList<String>();
+
+ Set<String> expected = new HashSet<String>();
+ expected.add("sb2-qemu-arm");
+ expected.add("sbrsh");
+
+ Properties env = ProcessLauncherUtils
+ .getSynthesizedEnvironment(commandAbstractor
+ .getProcessLauncherFactory());
+ String pathenv = env.getProperty("PATH");
+ if (pathenv == null) {
+ pathenv = "/usr/bin:/bin"; // XXX
+ }
+ if (pathenv != null) {
+ String[] paths = pathenv.split(":");
+ for (String exp : expected) {
+ for (String path : paths) {
+ IFileStore bin = commandAbstractor.getFileSystemAccess()
+ .getFileStore(new Path(path).append(exp));
+ if (bin.fetchInfo().exists()) {
+ cputranspAvailable.add(bin.toURI().getPath());
+ break;
+ }
+ }
+ }
+ }
+
+ return cputranspAvailable;
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 0;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListInstalledMaemoRootstrapsSb2Command.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListInstalledMaemoRootstrapsSb2Command.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListInstalledMaemoRootstrapsSb2Command.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.command;
+
+import org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * List the maemo rootstraps installed
+ */
+public class ListInstalledMaemoRootstrapsSb2Command extends
+ MaemoRootstrapSb2Command {
+
+ public ListInstalledMaemoRootstrapsSb2Command(
+ ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ @Override
+ protected boolean checkParameters(List<String> param) {
+ return param.size() == 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public List<String> performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String availableAction = commandAbstractor
+ .getPreferenceValue(SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_LIST_ACT);
+
+ List<String> installed = doPerformCommand(Collections
+ .singletonList(availableAction), null, 0);
+
+ return installed;
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 0;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListTargetsCommand.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListTargetsCommand.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListTargetsCommand.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.command;
+
+import org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.List;
+
+/**
+ * List the installed targets. This command wraps the callback to service (sb1)
+ * sb-conf list --targets or sb2-config -l (sb2)
+ *
+ */
+public class ListTargetsCommand extends AbstractSb2Command {
+
+ public ListTargetsCommand(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public List<String> performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String listAction;
+ String targetsOption;
+ listAction = commandAbstractor
+ .getPreferenceValue(SB2PreferenceConstants.SB2_LIST_ACT);
+ targetsOption = "";
+
+ String listTargetsCommandString = this.replaceScratchboxConfigCommand(
+ listAction, new String[] { targetsOption });
+
+ Process process = createProcess(listTargetsCommandString, null);
+
+ List<String> targetsAvailable = getLineInputFromProcessAndWait(process,
+ true, 0);
+
+ return targetsAvailable;
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 0;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/MaemoRootstrapSb2Command.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/MaemoRootstrapSb2Command.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/MaemoRootstrapSb2Command.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.command;
+
+import org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.env.IEnvironmentModifierBlock;
+import org.maemo.mica.common.core.process.CommandLineArguments;
+import org.maemo.mica.common.core.process.ShellTemplateSubstitutor;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Base class for maemo rootstrap command.
+ */
+public abstract class MaemoRootstrapSb2Command extends AbstractSb2Command {
+
+ public MaemoRootstrapSb2Command(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ @Override
+ protected boolean checkParameters(List<String> param) {
+ return true;
+ }
+
+ /**
+ * Override if stderr output is allowed.
+ *
+ * @return false
+ */
+ protected boolean allowErrors() {
+ return false;
+
+ }
+
+ /**
+ * Perform the command with the given params as command line arguments, with
+ * an optional timeout (triggering ScratchboxException if reached)
+ *
+ * @param params
+ * command line parameters to maemo-rootstrap
+ * @param envBlock
+ * any environment needed or <code>null</code>
+ * @param timeout
+ * if not 0, timeout in milliseconds
+ * @return lines from stdout
+ * @throws ScratchboxException
+ * if command execution fails or if timeout reached
+ */
+ @SuppressWarnings("unchecked")
+ protected List<String> doPerformCommand(List<String> params,
+ IEnvironmentModifierBlock envBlock, long timeout)
+ throws ESboxException {
+ String rootstrapCommand = commandAbstractor
+ .getPreferenceValue(SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_COMMAND);
+
+ String options = CommandLineArguments.toCommandLine(params);
+
+ ShellTemplateSubstitutor substitutor = new ShellTemplateSubstitutor();
+ substitutor.define("OPTIONS", options);
+
+ rootstrapCommand = substitutor.substitute(rootstrapCommand);
+
+ if (console == null) {
+ Process process = createProcess(rootstrapCommand, envBlock);
+ List<String> results = getLineInputFromProcessAndWait(process,
+ allowErrors(), timeout);
+ return results;
+ } else {
+ runAndWaitForProcess("Running " + rootstrapCommand,
+ rootstrapCommand, envBlock, timeout);
+ return Collections.EMPTY_LIST;
+ }
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 0;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/RemoveMaemoRootstrapSb2Command.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/RemoveMaemoRootstrapSb2Command.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/RemoveMaemoRootstrapSb2Command.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.command;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.CorePlugin;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.env.IEnvironmentModifierBlock;
+import org.maemo.mica.common.core.process.ProcessLauncherUtils;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Remove a maemo rootstrap. Parameters are target name and force boolean flag.
+ */
+public class RemoveMaemoRootstrapSb2Command extends MaemoRootstrapSb2Command {
+
+ private final IProgressMonitor monitor;
+
+ public RemoveMaemoRootstrapSb2Command(ICommandAbstractor commandAbstractor,
+ IProgressMonitor monitor) {
+ super(commandAbstractor);
+ this.monitor = monitor;
+ }
+
+ @Override
+ protected boolean checkParameters(List<String> param) {
+ return param.size() == 2;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public Boolean performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String targetName = param.get(0);
+ String forceFlag = param.get(1);
+
+ String action = commandAbstractor
+ .getPreferenceValue(SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_REMOVE_ACT);
+
+ List<String> commands = new ArrayList<String>();
+
+ if (forceFlag.equals(Boolean.TRUE.toString())) {
+ String force = commandAbstractor
+ .getPreferenceValue(SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_FORCE_OPT);
+ commands.add(force);
+ }
+ commands.add(action);
+ commands.add(targetName);
+
+ IEnvironmentModifierBlock envBlock = commandAbstractor
+ .getProcessLauncherFactory().defaultEnvironmentModifierBlock();
+ ProcessLauncherUtils.defineProxyVariables(envBlock);
+
+ setMonitorAndConsole(monitor, CorePlugin.getDefault().getConsole(true,
+ null, "Removing rootstrap " + targetName));
+
+ doPerformCommand(commands, envBlock, 0);
+
+ return Boolean.TRUE;
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 0;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/RemoveTargetSb2Command.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/RemoveTargetSb2Command.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/RemoveTargetSb2Command.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.command;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.runtime.CoreException;
+import org.maemo.esbox.internal.scratchbox.sb2.core.Scratchbox2SDK;
+import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.sdk.ISDK;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Remove a Scratchbox 2 target. There's no known command for this, but we can
+ * manually fix up the system.
+ *
+ */
+public class RemoveTargetSb2Command extends AbstractSb2Command {
+
+ private Scratchbox2SDK sdk;
+
+ public RemoveTargetSb2Command(ISDK sdk, ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ this.sdk = (Scratchbox2SDK) sdk;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+ * .lang.Object)
+ */
+ public Object performCommand(List<String> param)
+ throws ScratchboxException, ESboxException {
+ if (!this.checkParameters(param))
+ throw new ScratchboxInvalidParameterException(
+ "Invalid number of parameters");
+
+ String targetToRemove = param.get(0);
+ if (!targetExist(targetToRemove))
+ throw new ScratchboxInvalidParameterException("Target "
+ + targetToRemove + " does not exist.");
+
+ IFileStore sb2Dir = commandAbstractor.getFileSystemAccess()
+ .getFileStore(sdk.getScratchbox2ConfigDirectory());
+ IFileStore targetDir = sb2Dir.getChild(targetToRemove);
+
+ if (!targetDir.fetchInfo().exists()) {
+ throw new ScratchboxInvalidParameterException("Target "
+ + targetToRemove
+ + " does not exist at the expected location: " + targetDir);
+ }
+
+ try {
+ targetDir.delete(EFS.NONE, null);
+ } catch (CoreException e) {
+ throw new ScratchboxException("Failed to delete rootstrap", e);
+ } finally {
+ sdk.refresh();
+ }
+
+ return true;
+ }
+
+ /**
+ * Verify if a target exists.
+ *
+ * @param targetToRemove
+ * the target to verify.
+ *
+ * @return true, if the target exists in Scratchbox; false, otherwise.
+ * @throws ScratchboxException
+ * if some problem occurrs while requesting Scratchbox services.
+ */
+ private boolean targetExist(String targetToRemove) throws ESboxException {
+ List<String> targetsAvailable = new ListTargetsCommand(
+ commandAbstractor).performCommand(new ArrayList<String>());
+ return targetsAvailable.contains(targetToRemove);
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 1;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ShowPathMappingSb2Command.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ShowPathMappingSb2Command.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ShowPathMappingSb2Command.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.scratchbox.sb2.command;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.process.*;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+import java.io.ByteArrayOutputStream;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Invoke 'sb2-show path' on a list of paths and return the mappings, or
+ * <code>null</code> for unmapped entries
+ *
+ * @author eswartz
+ *
+ */
+public class ShowPathMappingSb2Command extends AbstractSb2Command {
+ public ShowPathMappingSb2Command(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ @Override
+ protected boolean checkParameters(List<String> param) {
+ return true;
+ }
+
+ public Map<IPath, IPath> performCommand(List<String> params)
+ throws ScratchboxException, ESboxException {
+ List<String> cmdLine = CommandLineArguments
+ .createFromVarArgs(
+ commandAbstractor
+ .getPreferenceValue(SB2PreferenceConstants.SB2_SB2_SHOW_COMMAND),
+ commandAbstractor
+ .getPreferenceValue(SB2PreferenceConstants.SB2_SB2_SHOW_PATH_ACTION));
+ cmdLine.addAll(params);
+
+ IProcessLauncher launcher = ProcessLauncherCreator
+ .createProcessLauncher(commandAbstractor
+ .getProcessLauncherFactory(), null, cmdLine);
+
+ launcher.createProcess();
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ByteArrayOutputStream err = new ByteArrayOutputStream();
+ launcher.waitAndRead(out, err);
+
+ if (err.size() != 0)
+ throw new ScratchboxException(
+ "Cannot resolve scratchbox2 path mappings:\n" + err);
+
+ String resolveInfo = out.toString().trim();
+ String[] lines = resolveInfo.split("\r\n|\r|\n");
+
+ Map<IPath, IPath> result = new HashMap<IPath, IPath>(lines.length);
+
+ Pattern sb2ShowPattern = Pattern
+ .compile(commandAbstractor
+ .getPreferenceValue(SB2PreferenceConstants.SB2_SB2_SHOW_PATH_OUTPUT_PATTERN));
+
+ for (String line : lines) {
+ Matcher matcher = sb2ShowPattern.matcher(line);
+ if (matcher.matches()) {
+ String toPath = matcher.group(2);
+ // workaround buggy output
+ if (toPath.startsWith("//"))
+ toPath = toPath.substring(1);
+ result.put(new Path(matcher.group(1)), new Path(toPath));
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public int getParametersSize() {
+ return 0;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2FileSystemMapping.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2FileSystemMapping.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2FileSystemMapping.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,84 @@
+/**
+ * (c) 2008 Nokia
+ */
+package org.maemo.esbox.internal.scratchbox.sb2.core;
+
+import com.nokia.cpp.internal.api.utils.core.Pair;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.maemo.esbox.internal.scratchbox.sb2.Activator;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.internal.api.common.core.machine.FileSystemMapping;
+import org.maemo.mica.internal.api.common.core.machine.IFileSystemMappingImpl;
+
+import java.util.*;
+
+/**
+ * Represent the mappings from the machine to a Scratchbox 2 target running on
+ * the machine. This represents the direct mappings with all softlinks resolved.
+ *
+ * @author eswartz
+ *
+ */
+public class Scratchbox2FileSystemMapping extends FileSystemMapping implements
+ IFileSystemMappingImpl {
+ /**
+ * Construct with default path canonicalizers and add mappings for paths
+ * known to be mapped.
+ *
+ * @param targetRoot
+ * @param target
+ */
+ public Scratchbox2FileSystemMapping(IScratchboxSDKTarget sdkTarget,
+ IPath scratchboxBase, String target, String user) {
+
+ super(FileSystemMapping.getMachineCanonicalizer(true),
+ FileSystemMapping.getMachineCanonicalizer(true));
+
+ List<Pair<IPath, IPath>> mappings = getHostToTargetRootMappings();
+ mappings.clear();
+
+ // directories we're interested in
+ String[] topLevelDirs = { "/dev", "/home", "/proc", "/sys", "/targets",
+ "/bin", "/boot", "/cdrom", "/etc", "/floppy", "/initrd",
+ "/lib", "/media", "/mnt", "/opt", "/root", "/sbin", "/srv",
+ "/usr",
+ "/var",
+
+ // things get messier, so be more specific
+ "/var/cache/apt", "/usr/include", "/usr/lib",
+ "/usr/local/include", "/usr/local/lib", "/usr/X11R6",
+ "/usr/local", "/home/user", };
+
+ List<IPath> topLevelPaths = new ArrayList<IPath>();
+ topLevelPaths.add(new Path("/"));
+ for (String topLevelDir : topLevelDirs) {
+ topLevelPaths.add(new Path(topLevelDir));
+ }
+
+ Map<IPath, IPath> pathMapping = null;
+ try {
+ pathMapping = Scratchbox2SDK.getSb2PathMapping(sdkTarget,
+ topLevelPaths);
+ // pathMapping = ScratchboxFacade.getInstance().getSb2PathMapping(
+ // sdkTarget, topLevelPaths);
+ } catch (ESboxException e) {
+ Activator.getErrorLogger().logError(
+ "Unable to map Scratchbox 2 paths", e);
+ return;
+ }
+
+ for (Map.Entry<IPath, IPath> entry : pathMapping.entrySet()) {
+ map(mappings, entry.getValue(), entry.getKey());
+ }
+
+ setHostToTargetRootMappings(mappings);
+ }
+
+ private void map(List<Pair<IPath, IPath>> mappings, IPath from, IPath to) {
+ mappings.add(new Pair<IPath, IPath>(from, to));
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDK.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDK.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDK.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,523 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Petr Baranov (Nokia) - initial API. Implementation from ScratchboxFacade
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.core;
+
+import org.eclipse.core.runtime.*;
+import org.maemo.esbox.internal.api.scratchbox.core.sdk.*;
+import org.maemo.esbox.internal.scratchbox.sb2.Activator;
+import org.maemo.esbox.internal.scratchbox.sb2.command.*;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+import org.maemo.esbox.scratchbox.sb2.sdk.IScratchbox2SDK;
+import org.maemo.esbox.scratchbox.sb2.sdk.MaemoRootstrap;
+import org.maemo.mica.common.core.CorePreferenceConstants;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.machine.IMachine;
+import org.maemo.mica.common.core.machine.MachineUtils;
+import org.maemo.mica.common.core.sdk.*;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+import org.maemo.mica.internal.api.common.core.sdk.BaseSDKPlatform;
+
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @author baranov
+ *
+ */
+public class Scratchbox2SDK extends AbstractScratchboxSDK implements
+ IScratchbox2SDK {
+
+ private static final IPath ROOT_PATH = new Path("/");
+ private static Pattern TARGET_PLATFORM_VERSION_ARCHITECTURE_PATTERN = Pattern
+ .compile("([a-zA-Z_]+)(\\d+)_([a-zA-Z]+)");
+
+ private static final String SB2_MACHINE = "sb2_machine";
+ private static final String SB2_VERSION = "sb2_version";
+
+ public Scratchbox2SDK(IMachine machine, String version,
+ IPreferenceProvider prefProvider) {
+ super(machine, version, "Scratchbox 2", SB2_MACHINE, SB2_VERSION,
+ "sb2_targets", 2);
+ this.prefProvider = prefProvider;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.maemosdk.core.sdk.AbstractScratchboxSDK#refresh()
+ */
+ public void refresh() {
+ super.refresh();
+ List<String> targetNames;
+ try {
+ targetNames = getTargets();
+ } catch (ESboxException e) {
+ Activator.getErrorLogger().logError("Could not refresh targets", e);
+ return;
+ }
+ List<ISDKTarget> newTargets = new ArrayList<ISDKTarget>();
+ for (String target : targetNames) {
+ // ignore this one, left behind by errant rootstrap installations
+ if (target.equals("libtool_build"))
+ continue;
+ IPath config = getScratchbox2ConfigDirectory();
+ IPath sb2BasePath = config.append(target);
+ Scratchbox2SDKTarget sdkTarget = new Scratchbox2SDKTarget(this,
+ getPlatform(target), getArchitecture(target), target,
+ sb2BasePath);
+ newTargets.add(sdkTarget);
+
+ try {
+ IPath sb2RootstrapPath = getMaemoRootstrapPath(sdkTarget);
+ sdkTarget.setRootstrapPath(sb2RootstrapPath);
+ } catch (ESboxException e) {
+ Activator.getErrorLogger().logError(null, e);
+ }
+
+ }
+ this.targets = newTargets;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.maemosdk.core.sdk.IScratchboxSDK#getTargets()
+ */
+ public List<String> getTargets() throws ESboxException {
+ CacheUtils.getInstance().ensureCurrentMachine(SB_MACHINE, this.getMachine());
+
+ String[] targetsArray = (String[]) CacheUtils.getInstance()
+ .getCachedValue(SB_TARGETS);
+ if (targetsArray != null)
+ return Arrays.asList(targetsArray);
+
+ ListTargetsCommand listTargetsCommand = new ListTargetsCommand(
+ getCommandAbstractor());
+ List<String> targets = listTargetsCommand
+ .performCommand(new ArrayList<String>());
+
+ CacheUtils.getInstance().setCachedValue(SB_TARGETS,
+ (String[]) targets.toArray(new String[targets.size()]));
+
+ return targets;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.maemosdk.core.sdk.AbstractScratchboxSDK#getCommandAbstractor
+ * ()
+ */
+ public ICommandAbstractor getCommandAbstractor() throws ESboxException {
+ return getSb2WrappedAbstractor(super.getCommandAbstractor(), this
+ .getMachine());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.maemo.esbox.maemosdk.sb2.core.IScratchbox2SDK#
+ * getScratchbox2ConfigDirectory()
+ */
+ public IPath getScratchbox2ConfigDirectory() {
+ String userName = prefProvider
+ .getPreferenceValue(CorePreferenceConstants.USER);
+ if (userName.length() == 0)
+ userName = "ubuntu";
+ return new Path("home").append(userName).append(".scratchbox2")
+ .makeAbsolute();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.maemosdk.core.sdk.IScratchboxSDK#createTarget(java.lang
+ * .String, java.lang.String, java.lang.String, java.lang.String)
+ */
+ public boolean createTarget(String targetName, String compiler,
+ String devkits, String cputransp) throws ESboxException {
+ List<String> params = new ArrayList<String>();
+ params.add(targetName);
+ params.add(compiler);
+ params.add(cputransp);
+
+ CreateTargetSb2Command createTargetCommand = new CreateTargetSb2Command(
+ this, getCommandAbstractor());
+
+ CacheUtils.getInstance().setCachedValue(SB_TARGETS, null);
+
+ return (Boolean) createTargetCommand.performCommand(params);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.maemosdk.core.sdk.IScratchboxSDK#getCompilers()
+ */
+ public List<String> getCompilers() throws ESboxException {
+ ListCompilersSb2Command listCompilersCommand = new ListCompilersSb2Command(
+ getCommandAbstractor());
+ return listCompilersCommand.performCommand(EMPTY_ARGS);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.maemosdk.core.sdk.IScratchboxSDK#getCputransp()
+ */
+ public List<String> getCputransp() throws ESboxException {
+ ListCputranspSb2Command listCputranspCommand = new ListCputranspSb2Command(
+ getCommandAbstractor());
+ return listCputranspCommand.performCommand(EMPTY_ARGS);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.maemosdk.core.sdk.IScratchboxSDK#getCurrentTarget()
+ */
+ public String getCurrentTarget() throws ESboxException {
+ GetCurrentTargetSb2Command getCurrentTargetCommand = new GetCurrentTargetSb2Command(
+ getCommandAbstractor());
+ return (String) getCurrentTargetCommand
+ .performCommand(new ArrayList<String>());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.maemosdk.core.sdk.IScratchboxSDK#removeTarget(java.lang
+ * .String)
+ */
+ public boolean removeTarget(String targetName) throws ESboxException {
+ List<String> params = new ArrayList<String>();
+ params.add(targetName);
+
+ RemoveTargetSb2Command removeTargetCommand;
+ removeTargetCommand = new RemoveTargetSb2Command(this,
+ getCommandAbstractor());
+ CacheUtils.getInstance().setCachedValue(SB_TARGETS, null);
+ CacheUtils.getInstance().setCachedValue(
+ SB2_TARGET_TO_PATH_MAPPINGS_MAP, null);
+ CacheUtils.getInstance().setCachedValue(SB2_TARGET_TO_ROOTSTRAP_MAP,
+ null);
+ return (Boolean) removeTargetCommand.performCommand(params);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.common.core.sdk.ISDK#getSDKRoot()
+ */
+ public IPath getSDKRoot() {
+ return ROOT_PATH;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.maemo.esbox.internal.maemosdk.core.sdk.
+ * IScratchboxSDKPlatformArchitectureProvider
+ * #getArchitecture(java.lang.String)
+ */
+ public String getArchitecture(String target) {
+ // convention says this is the part of the target after the underscore
+ Matcher matcher = TARGET_PLATFORM_VERSION_ARCHITECTURE_PATTERN
+ .matcher(target);
+ if (matcher.matches()) {
+ return matcher.group(3).toUpperCase();
+ } else {
+ return IScratchboxSDKTarget.ARCHITECTURE_UNKNOWN;
+ }
+ }
+
+ public ISDKPlatform getPlatform(String target) {
+ // convention says this is the part of the target before the underscore,
+ // minus a version.
+ Matcher matcher = TARGET_PLATFORM_VERSION_ARCHITECTURE_PATTERN
+ .matcher(target);
+ if (matcher.matches()) {
+ String name = matcher.group(1);
+ String platformName = name.substring(0, 1).toUpperCase()
+ + name.substring(1).toLowerCase();
+ String versionInfo = matcher.group(2);
+ String version = ISDKPlatform.VERSION_UNKNOWN;
+ if (versionInfo.length() == 2)
+ version = versionInfo.substring(0, 1) + "."
+ + versionInfo.substring(1, 2);
+ return new BaseSDKPlatform(platformName, version);
+ } else {
+ return new BaseSDKPlatform(ISDKPlatform.NAME_UNKNOWN,
+ ISDKPlatform.VERSION_UNKNOWN);
+ }
+ }
+
+ /**
+ * Get the names of rootstraps already installed. This may inclue those that
+ * do not have targets associated.
+ *
+ * @param sdk
+ * the SDK to check
+ * @return List, never null
+ * @throws ESboxException
+ */
+ public synchronized List<String> getInstalledMaemoRootstraps()
+ throws ESboxException {
+ ListInstalledMaemoRootstrapsSb2Command command = new ListInstalledMaemoRootstrapsSb2Command(
+ MachineUtils.getHostCommandAbstractor(this.getMachine()));
+ return command.performCommand(EMPTY_ARGS);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.maemosdk.sb2.core.IScratchbox2SDK#getAvailableMaemoRootstraps
+ * (org.maemo.mica.common.core.machine.IMachine)
+ */
+ public List<MaemoRootstrap> getAvailableMaemoRootstraps(IMachine machine)
+ throws ESboxException {
+ ListAvailableMaemoRootstrapsSb2Command command = new ListAvailableMaemoRootstrapsSb2Command(
+ MachineUtils.getHostCommandAbstractor(machine));
+ return command.performCommand(EMPTY_ARGS);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.maemosdk.sb2.core.IScratchbox2SDK#createRootstrapTarget
+ * (java.lang.String, boolean, boolean,
+ * org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public boolean createRootstrapTarget(String targetName,
+ boolean useHostTools, boolean force, IProgressMonitor monitor)
+ throws ESboxException {
+ List<String> params = new ArrayList<String>();
+ params.add(targetName);
+ params.add(Boolean.toString(useHostTools));
+ params.add(Boolean.toString(force));
+
+ CreateMaemoRootstrapSb2Command createTargetCommand = new CreateMaemoRootstrapSb2Command(
+ this, getCommandAbstractor(), monitor);
+
+ CacheUtils.getInstance().setCachedValue(SB_TARGETS, null);
+
+ return createTargetCommand.performCommand(params);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.maemosdk.sb2.core.IScratchbox2SDK#removeRootstrap(java
+ * .lang.String, boolean, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public boolean removeRootstrap(String targetName, boolean force,
+ IProgressMonitor monitor) throws ESboxException {
+ List<String> params = new ArrayList<String>();
+ params.add(targetName);
+ params.add(Boolean.toString(force));
+
+ RemoveMaemoRootstrapSb2Command removeTargetCommand = new RemoveMaemoRootstrapSb2Command(
+ getCommandAbstractor(), monitor);
+
+ CacheUtils.getInstance().setCachedValue(SB_TARGETS, null);
+ CacheUtils.getInstance().setCachedValue(SB2_TARGET_TO_ROOTSTRAP_MAP,
+ null);
+ CacheUtils.getInstance().setCachedValue(
+ SB2_TARGET_TO_PATH_MAPPINGS_MAP, null);
+
+ return removeTargetCommand.performCommand(params);
+ }
+
+ /**
+ * Invoke sb2-show path on the given path(s) to return the mappings.
+ *
+ * @param hostPaths
+ * array of paths to map
+ * @return map of resolved host paths to target paths
+ * @throws ESboxException
+ */
+ public static synchronized Map<IPath, IPath> getSb2PathMapping(
+ IScratchboxSDKTarget sdkTarget, List<IPath> hostPaths)
+ throws ESboxException {
+ // find cached value
+ CacheUtils.getInstance().ensureCurrentMachine(SB2_MACHINE, sdkTarget.getSDK()
+ .getMachine());
+ Map<String, Map<String, String>> targetToPathMappingsMap = null;
+ Map<String, String> storedPathMappings = null;
+ targetToPathMappingsMap = (Map<String, Map<String, String>>) CacheUtils
+ .getInstance().getCachedValue(SB2_TARGET_TO_PATH_MAPPINGS_MAP);
+ if (targetToPathMappingsMap != null) {
+ storedPathMappings = targetToPathMappingsMap.get(sdkTarget
+ .getName());
+ }
+
+ Map<IPath, IPath> returnedPathMappings = new HashMap<IPath, IPath>();
+
+ // locate entries known to the cache
+ List<IPath> needToLookupHostPaths;
+ if (storedPathMappings != null) {
+ needToLookupHostPaths = new ArrayList<IPath>();
+ for (IPath hostPath : hostPaths) {
+ String targetPath = storedPathMappings.get(hostPath
+ .toPortableString());
+ if (targetPath != null) {
+ returnedPathMappings.put(hostPath, new Path(targetPath));
+ } else {
+ needToLookupHostPaths.add(hostPath);
+ }
+ }
+ } else {
+ needToLookupHostPaths = hostPaths;
+ }
+
+ if (needToLookupHostPaths.size() == 0) {
+ return returnedPathMappings;
+ }
+
+ // do the hard work for the paths not covered by the cache
+ ShowPathMappingSb2Command command = new ShowPathMappingSb2Command(
+ ((Scratchbox2SDKTarget)sdkTarget).getCommandAbstractor());
+ List<String> paths = new ArrayList<String>(needToLookupHostPaths.size());
+ for (IPath path : needToLookupHostPaths) {
+ paths.add(path.toPortableString());
+ }
+
+ Map<IPath, IPath> newPathMappings = (Map<IPath, IPath>) command
+ .performCommand(paths);
+ returnedPathMappings.putAll(newPathMappings);
+
+ // update cache
+ if (storedPathMappings == null) {
+ storedPathMappings = new HashMap<String, String>();
+ }
+ for (Map.Entry<IPath, IPath> entry : newPathMappings.entrySet()) {
+ storedPathMappings.put(entry.getKey().toPortableString(), entry
+ .getValue().toPortableString());
+ }
+ if (targetToPathMappingsMap == null) {
+ targetToPathMappingsMap = new HashMap<String, Map<String, String>>();
+ }
+ targetToPathMappingsMap.put(sdkTarget.getName(), storedPathMappings);
+
+ CacheUtils.getInstance().setCachedValue(
+ SB2_TARGET_TO_PATH_MAPPINGS_MAP, targetToPathMappingsMap);
+
+ return returnedPathMappings;
+ }
+
+ /**
+ * Return the current version of Scratchbox 2
+ *
+ * @return the current version of Scratchbox 2.
+ * @throws ESboxException
+ * if any problem related to Scratchbox communication occurs,
+ * including no scratchbox 2 detected
+ */
+ public static synchronized String getCurrentSboxVersion(IMachine machine)
+ throws ESboxException {
+ // find cached value
+ CacheUtils.getInstance().ensureCurrentMachine(SB2_MACHINE, machine);
+ String version = (String) CacheUtils.getInstance().getCachedValue(
+ SB2_VERSION);
+ if (version != null)
+ return version;
+
+ // do the hard work
+ MachineUtils.acquireMachine(machine);
+ ICommandAbstractor commandAbstractor = MachineUtils
+ .getHostCommandAbstractor(machine);
+ commandAbstractor = getSb2WrappedAbstractor(commandAbstractor, machine);
+ GetVersionScratchboxCommand getVersionCommand = new GetVersionScratchboxCommand(
+ commandAbstractor);
+
+ String currentVersion = getVersionCommand
+ .performCommand(new ArrayList<String>());
+ // remember cached value
+ CacheUtils.getInstance().setCachedValue(SB2_VERSION, currentVersion);
+
+ return currentVersion;
+ }
+
+ /**
+ * Get the path where a maemo rootstrap is installed
+ *
+ * @param scratchbox2SDKTarget
+ * @return path of rootstrap
+ * @throws ESboxException
+ * if not located
+ */
+ private synchronized IPath getMaemoRootstrapPath(
+ Scratchbox2SDKTarget sdkTarget) throws ESboxException {
+ // find cached value
+ CacheUtils.getInstance().ensureCurrentMachine(SB_MACHINE, sdkTarget.getSDK()
+ .getMachine());
+ Map<String, String> targetToRootstrapMap = null;
+ targetToRootstrapMap = (Map<String, String>) CacheUtils.getInstance()
+ .getCachedValue(SB2_TARGET_TO_ROOTSTRAP_MAP);
+ if (targetToRootstrapMap != null) {
+ String rootstrap = targetToRootstrapMap.get(sdkTarget.getName());
+ if (rootstrap != null) {
+ return new Path(rootstrap);
+ }
+ }
+
+ // do the hard work
+ GetMaemoRootstrapLocationCommand command = new GetMaemoRootstrapLocationCommand(
+ getCommandAbstractor(), sdkTarget);
+ IPath rootstrapPath;
+
+ // be sure to record something in the cache for broken targets so
+ // we don't keep asking all the time
+ ESboxException caughtException = null;
+ try {
+ rootstrapPath = (IPath) command.performCommand(EMPTY_ARGS);
+ } catch (ESboxException e) {
+ rootstrapPath = Path.EMPTY;
+ caughtException = e;
+ }
+
+ // store cached value
+ if (targetToRootstrapMap == null)
+ targetToRootstrapMap = new HashMap<String, String>();
+ targetToRootstrapMap.put(sdkTarget.getName(), rootstrapPath
+ .toPortableString());
+ CacheUtils.getInstance().setCachedValue(SB2_TARGET_TO_ROOTSTRAP_MAP,
+ targetToRootstrapMap);
+
+ if (caughtException != null)
+ throw caughtException;
+
+ return rootstrapPath;
+ }
+
+ /**
+ * Get a command abstractor that updates the PATH if sb2 tools are not on
+ * the path.
+ *
+ * @param commandAbstractor
+ * @param machine
+ * @return
+ */
+ private static ICommandAbstractor getSb2WrappedAbstractor(
+ ICommandAbstractor commandAbstractor, IMachine machine) {
+ // XXX: the default path should be provided some other way
+ return wrapCommandAbstractorForSDK(commandAbstractor, machine, "sb2",
+ "/usr/bin");
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDKTarget.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDKTarget.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDKTarget.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Petr Baranov (Nokia) - initial API. Implementation from ScratchboxFacade
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.core;
+
+import org.eclipse.core.runtime.IPath;
+import org.maemo.esbox.internal.api.scratchbox.core.sdk.AbstractScratchboxSDKTarget;
+import org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants;
+import org.maemo.esbox.internal.scratchbox.sb2.command.GetGdbQemuCommandPatternCommand;
+import org.maemo.esbox.internal.scratchbox.sb2.launcher.Scratchbox2ProcessLauncherFactory;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+import org.maemo.mica.common.core.CorePreferenceConstants;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.process.IProcessLauncherFactory;
+import org.maemo.mica.common.core.sdk.ISDKPlatform;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author baranov
+ *
+ */
+public class Scratchbox2SDKTarget extends AbstractScratchboxSDKTarget {
+ private IPath targetRoot;
+ private IPath rootstrapRoot;
+
+ public Scratchbox2SDKTarget(Scratchbox2SDK sdk, ISDKPlatform platform,
+ String architecture, String target, IPath targetRoot) {
+ super(sdk, platform, architecture, target);
+ if (targetRoot == null)
+ throw new IllegalArgumentException();
+ this.targetRoot = targetRoot;
+ init(new Scratchbox2FileSystemMapping(this, targetRoot, target, sdk
+ .getPreferenceValue(CorePreferenceConstants.USER))
+ // ,new AptPackageManager(this)
+ );
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget#
+ * getProcessLauncherFactoryForInstall()
+ */
+ public IProcessLauncherFactory getProcessLauncherFactoryForInstall() {
+ // install mode needs to be a different mapping and also run as root
+ return new Scratchbox2ProcessLauncherFactory(this,
+ SB2PreferenceConstants.SB2_INSTALL_MAPPING_MODE, true);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.maemosdk.core.sdk.IScratchboxSDKTarget#getRootstrapPath()
+ */
+ public IPath getRootstrapPath() {
+ return rootstrapRoot;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.common.core.sdk.ISDKTarget#getProcessLauncherFactory()
+ */
+ public IProcessLauncherFactory getProcessLauncherFactory() {
+ // default is build mode
+ return new Scratchbox2ProcessLauncherFactory(this,
+ SB2PreferenceConstants.SB2_MAPPING_MODE, false);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.common.core.sdk.ISDKTarget#getSDKTargetRoot()
+ */
+ public IPath getSDKTargetRoot() {
+ return targetRoot;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.internal.api.common.core.sdk.BaseSDKTarget#getArchitecture()
+ */
+ public String getArchitecture() {
+ // sb2 doesn't YET ship an x86 emulator
+ return IScratchboxSDKTarget.ARCHITECTURE_ARMEL;
+ }
+
+ /**
+ * Get the command template for launching qemu under gdb with this target
+ *
+ * @param sdkTarget
+ * @param architecture
+ * one of {@link IScratchboxSDKTarget#ARCHITECTURE_ARMEL} or
+ * {@link IScratchboxSDKTarget#ARCHITECTURE_X86}; usually from
+ * sdkTarget.getArchitecture()
+ * @return String or null if no cputransp used or not using qemu
+ */
+ public synchronized String getGdbQemuCommandPattern(String architecture)
+ throws ESboxException {
+ // ScratchboxSDK2 sdk = (ScratchboxSDK2)this.getSDK();
+ GetGdbQemuCommandPatternCommand command = new GetGdbQemuCommandPatternCommand(
+ this, this.getCommandAbstractor());
+ List<String> arguments = new ArrayList<String>(1);
+ arguments.add(architecture);
+ return command.performCommand(arguments);
+ }
+
+ /** Not API! The targets should be refreshed from ISDK#refresh() */
+ void setRootstrapPath(IPath rootstrapPath) {
+ this.rootstrapRoot = rootstrapPath;
+ }
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/launcher/Scratchbox2EnvironmentProvider.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/launcher/Scratchbox2EnvironmentProvider.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/launcher/Scratchbox2EnvironmentProvider.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.scratchbox.sb2.launcher;
+
+import org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants;
+import org.maemo.esbox.internal.scratchbox.sb2.Activator;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.process.*;
+import org.maemo.mica.common.core.process.ProcessLauncherUtils.Results;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.internal.api.common.core.IStandardEnvironmentProvider;
+
+import java.util.*;
+
+/**
+ * @author eswartz
+ *
+ */
+public class Scratchbox2EnvironmentProvider implements
+ IStandardEnvironmentProvider {
+ public static Map<ISDKTarget, Properties> cachedStdEnvMap = new HashMap<ISDKTarget, Properties>();
+ private final ISDKTarget sdkTarget;
+
+ /**
+ * @param sdkTarget
+ */
+ public Scratchbox2EnvironmentProvider(ISDKTarget sdkTarget) {
+ this.sdkTarget = sdkTarget;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.maemo.esbox.internal.api.core.IStandardEnvironmentProvider#
+ * flushRawEnvironment()
+ */
+ public void flushRawEnvironment() {
+ cachedStdEnvMap.remove(sdkTarget);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.maemo.esbox.internal.api.core.IStandardEnvironmentProvider#
+ * getRawEnvironment()
+ */
+ public Properties getRawEnvironment() {
+ Properties standardEnv = cachedStdEnvMap.get(sdkTarget);
+ if (standardEnv == null) {
+ // gather arguments by querying a typical shell launched in POSIX
+ // mode (sh instead of bash)
+ Scratchbox2ProcessLauncher launcher = new Scratchbox2ProcessLauncher(
+ sdkTarget, null, CommandLineArguments.createFromVarArgs(
+ "sh", "-c", "set"), null,
+ SB2PreferenceConstants.SB2_MAPPING_MODE, false);
+
+ try {
+ Results results = ProcessLauncherUtils
+ .launchAndReadStandardStreams(launcher, null);
+ standardEnv = EnvironmentProperties
+ .createFromShellEnvDump(results.stdout);
+ } catch (ESboxException e) {
+ Activator
+ .getErrorLogger()
+ .logError(
+ "Failed to read scratchbox environment; using system environment",
+ e);
+ standardEnv = sdkTarget.getSDK().getMachine()
+ .getStandardEnvironment();
+ }
+
+ cachedStdEnvMap.put(sdkTarget, standardEnv);
+ }
+ return standardEnv;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/launcher/Scratchbox2ProcessLauncher.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/launcher/Scratchbox2ProcessLauncher.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/launcher/Scratchbox2ProcessLauncher.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.launcher;
+
+import org.eclipse.core.runtime.IPath;
+import org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.env.IEnvironmentModifierBlock;
+import org.maemo.mica.common.core.process.*;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+
+import java.util.List;
+
+/**
+ * For SB 2, launching is easy and follows the same pattern as a normal program
+ * invocation.
+ *
+ * @author eswartz
+ *
+ */
+public class Scratchbox2ProcessLauncher extends BaseSDKTargetProcessLauncher implements
+ IProcessLauncher {
+
+ private ISDKTarget sdkTarget;
+
+ public Scratchbox2ProcessLauncher(ISDKTarget sdkTarget,
+ IPath workingDirectory, List<String> cmdLine,
+ IEnvironmentModifierBlock environmentModifierBlock, String modeKey,
+ boolean runAsRoot) {
+ super(encodeArgumentArray(sdkTarget, cmdLine, modeKey),
+ environmentModifierBlock, workingDirectory,
+ sdkTarget);
+ if (runAsRoot) {
+ getLaunchCommandArguments().add(0, "sudo");
+ }
+ if (sdkTarget == null)
+ throw new IllegalArgumentException();
+ this.sdkTarget = sdkTarget;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.internal.common.core.BaseProcessLauncher#getLaunchInfoPrefix()
+ */
+ @Override
+ protected String getLaunchInfoPrefix() {
+ return sdkTarget + " ";
+ }
+
+ private static List<String> encodeArgumentArray(ISDKTarget sdkTarget,
+ List<String> cmdLine, String modeKey) {
+
+ // Encode the launch command by replacing the arguments
+ // representing template arguments with the actual values.
+ //
+ ShellTemplateSubstitutor substitutor = new ShellTemplateSubstitutor();
+
+ substitutor.define("TARGET", sdkTarget.getName());
+ substitutor.define("COMMAND", cmdLine.get(0));
+ substitutor.define("ARGS", CommandLineArguments.toCommandLine(cmdLine
+ .subList(1, cmdLine.size())));
+
+ String level = sdkTarget
+ .getPreferenceValue(SB2PreferenceConstants.SB2_LOG_LEVEL);
+ if (level.length() > 0) {
+ substitutor.define("LOG_OPTION", "-L " + level);
+ } else {
+ substitutor.define("LOG_OPTION", "");
+ }
+
+ String mapMode = sdkTarget.getPreferenceValue(modeKey);
+ substitutor.define("MAPPING_MODE", mapMode);
+
+ // get the Scratchbox invocation pattern
+ String commandPattern = sdkTarget
+ .getPreferenceValue(SB2PreferenceConstants.SB2_EXEC_COMMAND);
+
+ // replace variables
+ commandPattern = substitutor.substitute(commandPattern);
+
+ List<String> commandArgs = CommandLineArguments
+ .createFromCommandLine(commandPattern);
+ return commandArgs;
+ }
+
+ @Override
+ protected void setupForLaunch() throws ESboxException {
+ // nothing
+ super.setupForLaunch();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.internal.common.core.BaseProcessLauncher#doCreateProcess()
+ */
+ @Override
+ protected Process doCreateProcess() throws Exception {
+ return sdkTarget.getSDK().getMachine().createProcess(
+ getLaunchCurrentWorkingDirectory(),
+ getLaunchCommandArguments(),
+ getLaunchEnvironmentModifierBlock(), isUsePTY());
+ }
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/launcher/Scratchbox2ProcessLauncherFactory.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/launcher/Scratchbox2ProcessLauncherFactory.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/launcher/Scratchbox2ProcessLauncherFactory.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.launcher;
+
+import org.eclipse.core.runtime.IPath;
+import org.maemo.mica.common.core.env.IEnvironmentModifierBlock;
+import org.maemo.mica.common.core.process.IProcessLauncher;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.internal.api.common.core.BaseProcessLauncherFactory;
+
+import java.util.List;
+
+/**
+ * @author eswartz
+ *
+ */
+public class Scratchbox2ProcessLauncherFactory extends
+ BaseProcessLauncherFactory {
+
+ protected ISDKTarget sdkTarget;
+ private String mappingModeKey;
+ private final boolean runAsRoot;
+
+ /**
+ * Create a factory and specify whether it is creating commands in build
+ * mode (sb2 -m maemo) or installation mode (sb2 -e)
+ *
+ * @param sdkTarget
+ * @param mappingModeKey
+ * one of SB2PreferenceConstants.MAPPING_MODE or
+ * SB2PreferenceConstants.INSTALL_MAPPING_MODE
+ * @param isBuildMode
+ * true: build mode, false: installation mode
+ */
+ public Scratchbox2ProcessLauncherFactory(ISDKTarget sdkTarget,
+ String mappingModeKey, boolean runAsRoot) {
+ super(new Scratchbox2EnvironmentProvider(sdkTarget), false);
+ if (sdkTarget == null)
+ throw new IllegalArgumentException();
+ this.sdkTarget = sdkTarget;
+ this.mappingModeKey = mappingModeKey;
+ this.runAsRoot = runAsRoot;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.common.core.IProcessLauncherFactory#createProcessLauncher(org
+ * .eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath,
+ * org.maemo.mica.common.core.List<String>, java.util.Properties)
+ */
+ protected IProcessLauncher doCreateProcessLauncher(IPath workingDirectory,
+ List<String> cmdLine,
+ IEnvironmentModifierBlock environmentModifierBlock) {
+
+ return new Scratchbox2ProcessLauncher(sdkTarget, workingDirectory,
+ cmdLine, environmentModifierBlock, mappingModeKey, runAsRoot);
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/provider/Scratchbox2SDKProvider.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/provider/Scratchbox2SDKProvider.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/provider/Scratchbox2SDKProvider.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.provider;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.maemo.esbox.internal.api.scratchbox.core.sdk.CacheUtils;
+import org.maemo.esbox.internal.scratchbox.sb2.Activator;
+import org.maemo.esbox.internal.scratchbox.sb2.core.Scratchbox2SDK;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.mica.common.core.*;
+import org.maemo.mica.common.core.machine.IMachine;
+import org.maemo.mica.common.core.machine.MachineRegistry;
+import org.maemo.mica.common.core.sdk.*;
+import org.maemo.mica.internal.api.common.core.sdk.UserAwarePreferenceProviderWrapper;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * This implementation of the SDK provider searches for SB2 targets using the
+ * 'sb2-config -l' command. If any aspect of SB2 communication fails, we assume
+ * SB2 is not installed.
+ *
+ * @author eswartz
+ *
+ */
+public class Scratchbox2SDKProvider implements ISDKProvider {
+
+ // this may need to be bumped once an official release is made
+ private static final String SCRATCHBOX_VERSION_PATTERN = "1\\.99\\..*"; //$NON-NLS-1$
+
+ /**
+ *
+ */
+ public Scratchbox2SDKProvider() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.common.core.sdk.ISDKProvider#createSDKs()
+ */
+ public List<ISDK> createSDKs() throws ESboxException {
+ ErrorLogger logger = Activator.getErrorLogger();
+
+ List<ISDK> sdks = new ArrayList<ISDK>();
+ for (IMachine machine : MachineRegistry.getInstance()
+ .getBuildMachines()) {
+ // will never find sbox on host (right?!)
+ if (machine.getOS().equals(Platform.OS_WIN32))
+ continue;
+
+ try {
+ IPreferenceProvider prefProvider = new UserAwarePreferenceProviderWrapper(
+ CorePreferenceManager.getInstance()
+ .getPreferenceProvider(), machine);
+ Scratchbox2SDK sdk = getMachineSDK(prefProvider, machine);
+ if (sdk != null) {
+ sdks.add(sdk);
+ sdk.refresh();
+ }
+ } catch (ScratchboxException e) {
+ logger.log(IStatus.INFO,
+ "Problem scanning Scratchbox 2 installation", e);
+ }
+ }
+
+ CacheUtils.getInstance().saveCachedData();
+
+ return sdks;
+ }
+
+ /**
+ * @param logger
+ * @param prefProvider
+ * @param sdks
+ * @return
+ * @throws ScratchboxException
+ */
+ private Scratchbox2SDK getMachineSDK(IPreferenceProvider prefProvider,
+ IMachine machine) throws ESboxException {
+ ErrorLogger logger = Activator.getErrorLogger();
+
+ // only support one Scratchbox 2 installation
+ String version = Scratchbox2SDK.getCurrentSboxVersion(machine);
+ if (version == null) {
+ // no scratchbox?
+ return null;
+ }
+
+ if (!version.matches(SCRATCHBOX_VERSION_PATTERN)) {
+ logger
+ .logError(
+ MessageFormat
+ .format(
+ "Only Scratchbox 2 version 1.99.x is supported (detected {0}); disabling Scratchbox 2 support",
+ version), null);
+ return null;
+ }
+
+ Scratchbox2SDK sdk = new Scratchbox2SDK(machine, version, prefProvider);
+
+ return sdk;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters/MaemoScratchbox2SDKManageTargetAdapter.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters/MaemoScratchbox2SDKManageTargetAdapter.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters/MaemoScratchbox2SDKManageTargetAdapter.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.scratchbox.sb2.ui.adapters;
+
+import org.eclipse.core.runtime.*;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.maemo.esbox.internal.api.scratchbox.ui.adapters.MaemoScratchboxSDKManageTargetAdapterBase;
+import org.maemo.esbox.internal.scratchbox.sb2.Activator;
+import org.maemo.esbox.internal.scratchbox.sb2.ui.wizard.NewScratchbox2TargetWizard;
+import org.maemo.esbox.scratchbox.sb2.sdk.IScratchbox2SDK;
+import org.maemo.esbox.scratchbox.sb2.sdk.MaemoRootstrap;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.Policy;
+import org.maemo.mica.common.core.adapters.ISDKManageTargetAdapter;
+import org.maemo.mica.common.core.sdk.ISDK;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.internal.api.maemosdk.ui.adapters.ESboxTargetRemover;
+
+import java.util.List;
+
+/**
+ * @author eswartz
+ *
+ */
+public class MaemoScratchbox2SDKManageTargetAdapter extends
+ MaemoScratchboxSDKManageTargetAdapterBase implements
+ ISDKManageTargetAdapter {
+
+ private final IScratchbox2SDK sdk;
+
+ /**
+ * @param sdk
+ */
+ public MaemoScratchbox2SDKManageTargetAdapter(IScratchbox2SDK sdk) {
+ this.sdk = sdk;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.common.core.adapters.ISDKManageTargetAdapter#installSDKTargets
+ * (org.eclipse.swt.widgets.Shell, java.util.List)
+ */
+ public IStatus installSDKTargets(Shell shell, List<ISDKTarget> installed) {
+ NewScratchbox2TargetWizard targetWizard;
+
+ targetWizard = new NewScratchbox2TargetWizard(sdk);
+ WizardDialog dlg = new WizardDialog(shell, targetWizard);
+ if (dlg.open() == Dialog.OK) {
+ return Status.OK_STATUS;
+ }
+
+ return Policy.getCancelStatus(Activator.getDefault());
+ }
+
+ protected ESboxTargetRemover createTargetRemover(Shell shell,
+ ISDKTarget target, boolean deleteRootstrap) {
+ return new ESboxTargetRemover(shell, target, deleteRootstrap) {
+
+
+ protected void doDeleteTargetRootstrap(IProgressMonitor monitor,
+ ISDK sdk) throws ESboxException {
+ ((IScratchbox2SDK) sdk).removeRootstrap(
+ sdkTarget.getName(), true, new SubProgressMonitor(
+ monitor, 1));
+ };
+
+ /* (non-Javadoc)
+ * @see org.maemo.mica.internal.api.maemosdk.ui.adapters.ESboxTargetRemover#doRemoveTarget(org.maemo.mica.common.core.sdk.ISDK, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected void doRemoveTarget(ISDK sdk, String targetName,
+ IProgressMonitor monitor) throws ESboxException {
+ ((IScratchbox2SDK) sdk).removeTarget(targetName);
+ monitor.worked(1);
+
+ }
+ };
+ }
+
+ @Override
+ protected boolean isRootStrapUsed(ISDKTarget selectedTarget) {
+ {
+ boolean rootstrapUsed_ = false;
+ try {
+ // see if a rootstrap -- possibly disconnected from the target --
+ // exists
+ List<MaemoRootstrap> rootstraps = sdk
+ .getAvailableMaemoRootstraps(selectedTarget.getSDK()
+ .getMachine());
+ for (MaemoRootstrap rootstrap : rootstraps) {
+ if (rootstrap.getName().equals(selectedTarget.getName())) {
+ rootstrapUsed_ = true;
+ break;
+ }
+ }
+ } catch (ESboxException e1) {
+ Activator.getErrorLogger().logError(
+ "Failure scanning maemo rootstraps", e1);
+ }
+ return rootstrapUsed_;
+ }
+ }
+
+
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters/MaemoScratchbox2SDKManageTargetAdapterFactory.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters/MaemoScratchbox2SDKManageTargetAdapterFactory.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters/MaemoScratchbox2SDKManageTargetAdapterFactory.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.scratchbox.sb2.ui.adapters;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.maemo.esbox.scratchbox.sb2.sdk.IScratchbox2SDK;
+import org.maemo.mica.common.core.adapters.ISDKManageTargetAdapter;
+
+/**
+ * @author eswartz
+ *
+ */
+public class MaemoScratchbox2SDKManageTargetAdapterFactory implements IAdapterFactory {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object,
+ * java.lang.Class)
+ */
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if (adapterType.equals(ISDKManageTargetAdapter.class)) {
+ if (adaptableObject instanceof IScratchbox2SDK) {
+ return new MaemoScratchbox2SDKManageTargetAdapter(
+ (IScratchbox2SDK) adaptableObject);
+ }
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
+ */
+ public Class[] getAdapterList() {
+ return new Class[] { ISDKManageTargetAdapter.class };
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/preferences/Scratchbox2PreferencesPage.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/preferences/Scratchbox2PreferencesPage.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/preferences/Scratchbox2PreferencesPage.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.scratchbox.sb2.ui.preferences;
+
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.RadioGroupFieldEditor;
+import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants;
+
+/**
+ * General preference page for scratchbox 2
+ *
+ * @author eswartz
+ */
+public class Scratchbox2PreferencesPage extends FieldEditorPreferencePage
+ implements IWorkbenchPreferencePage {
+
+ /**
+ * Field for build mapping mode
+ */
+ private StringFieldEditor feSbox2BuildMappingMode = null;
+ /**
+ * Field for install mapping mode
+ */
+ private StringFieldEditor feSbox2InstallMappingMode = null;
+
+ /**
+ * Field for log level
+ */
+ private RadioGroupFieldEditor feSbox2LogLevel = null;
+
+ private StringFieldEditor feSbox2CommandLine;
+
+ /**
+ * The constructor
+ */
+ public Scratchbox2PreferencesPage() {
+ super(GRID);
+ setPreferenceStore(SB2PreferenceConstants.getPreferenceStore());
+ setDescription("Options configuring scratchbox 2");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors
+ * ()
+ */
+ public void createFieldEditors() {
+
+ feSbox2BuildMappingMode = new StringFieldEditor(
+ SB2PreferenceConstants.SB2_MAPPING_MODE.toString(),
+ "Build mapping mode:", getFieldEditorParent());
+
+ feSbox2InstallMappingMode = new StringFieldEditor(
+ SB2PreferenceConstants.SB2_INSTALL_MAPPING_MODE.toString(),
+ "Install mapping mode:", getFieldEditorParent());
+
+ feSbox2LogLevel = new RadioGroupFieldEditor(
+ SB2PreferenceConstants.SB2_LOG_LEVEL.toString(),
+ "Logging level:", 1, new String[][] { { "none", "" }, //$NON-NLS-1$
+ { "error", "error" }, //$NON-NLS-1$
+ { "warning", "warning" }, //$NON-NLS-1$
+ { "notice", "notice" }, //$NON-NLS-1$
+ { "info", "info" }, //$NON-NLS-1$
+ { "debug", "debug" }, //$NON-NLS-1$
+ { "noise", "noise" }, //$NON-NLS-1$
+ }, getFieldEditorParent());
+
+ feSbox2CommandLine = new StringFieldEditor(
+ SB2PreferenceConstants.SB2_EXEC_COMMAND.toString(),
+ "Command template:", getFieldEditorParent());
+
+ // make this string manageable
+ GC gc = new GC(getFieldEditorParent().getShell());
+ GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gridData.widthHint = gc.getAdvanceWidth('m') * 32;
+ gc.dispose();
+ feSbox2CommandLine.getTextControl(getFieldEditorParent())
+ .setLayoutData(gridData);
+
+ addField(feSbox2BuildMappingMode);
+ addField(feSbox2InstallMappingMode);
+ addField(feSbox2LogLevel);
+ addField(feSbox2CommandLine);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ public void init(IWorkbench workbench) {
+ // Nothing to do
+ }
+
+}
\ No newline at end of file
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/MaemoRootstrapContentLabelProvider.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/MaemoRootstrapContentLabelProvider.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/MaemoRootstrapContentLabelProvider.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,178 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.scratchbox.sb2.ui.wizard;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.viewers.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.widgets.Display;
+import org.maemo.esbox.scratchbox.sb2.sdk.IScratchbox2SDK;
+import org.maemo.esbox.scratchbox.sb2.sdk.MaemoRootstrap;
+import org.maemo.mica.common.core.ESboxException;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * This class provides installable rootstraps, descriptions, etc. from the
+ * result of 'maemo-rootstrap'.
+ *
+ * @author eswartz
+ *
+ */
+public class MaemoRootstrapContentLabelProvider extends LabelProvider implements
+ ITreeContentProvider, ITableLabelProvider, IColorProvider,
+ IFontProvider {
+ static final int COLUMN_NAME = 0;
+ static final int COLUMN_ARCHITECTURE = 1;
+ static final int COLUMN_DESCRIPTION = 2;
+
+ public static Object NO_ROOTSTRAP = new Object();
+ public static Object LOADING_LABEL = new Object();
+
+ private boolean rootstrapsFetched;
+ // either MaemoRootstrap or NO_ROOTSTRAP
+ private List<Object> rootstraps;
+ private Thread rootstrapThread;
+ private final IScratchbox2SDK sdk;
+
+ public MaemoRootstrapContentLabelProvider(IScratchbox2SDK sdk) {
+ this.sdk = sdk;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ if (!rootstrapsFetched) {
+ rootstraps = new ArrayList<Object>();
+ rootstraps.add(NO_ROOTSTRAP);
+ rootstraps.add(LOADING_LABEL);
+
+ if (rootstrapThread == null) {
+ rootstrapThread = new Thread(new Runnable() {
+
+ public void run() {
+ try {
+ List<MaemoRootstrap> realRootstraps = sdk
+ .getAvailableMaemoRootstraps(sdk
+ .getMachine());
+ synchronized (rootstraps) {
+ rootstraps.remove(1);
+ rootstraps.addAll(realRootstraps);
+ }
+ } catch (final ESboxException e) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ public void run() {
+ MessageDialog.openError(null,
+ "Rootstrap lookup failed",
+ "Error fetching rootstraps: check proxy settings?\n\n"
+ + e.getMessage());
+ }
+
+ });
+ }
+ rootstrapsFetched = true;
+ rootstrapThread = null;
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ fireLabelProviderChanged(new LabelProviderChangedEvent(
+ MaemoRootstrapContentLabelProvider.this));
+ }
+
+ });
+ }
+
+ });
+ rootstrapThread.start();
+ }
+ }
+ synchronized (rootstraps) {
+ return rootstraps.toArray();
+ }
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ return new Object[0];
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ return false;
+ }
+
+ public void dispose() {
+
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ viewer.refresh();
+ }
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+ switch (columnIndex) {
+ case COLUMN_NAME:
+ if (element == NO_ROOTSTRAP) {
+ return "Custom target";
+ } else if (element == LOADING_LABEL) {
+ return "Loading...";
+ } else {
+ return ((MaemoRootstrap) element).getName();
+ }
+
+ case COLUMN_ARCHITECTURE:
+ if (element == NO_ROOTSTRAP || element == LOADING_LABEL) {
+ return null;
+ }
+ return ((MaemoRootstrap) element).getArchitecture();
+
+ case COLUMN_DESCRIPTION:
+ if (element == NO_ROOTSTRAP) {
+ return "User-defined name and compiler, manually installed rootstrap";
+ } else if (element == LOADING_LABEL) {
+ return null;
+ } else {
+ return ((MaemoRootstrap) element).getDescription();
+ }
+ }
+ return null;
+ }
+
+ public Color getBackground(Object element) {
+ return null;
+ }
+
+ public Color getForeground(Object element) {
+ if (element == LOADING_LABEL)
+ return Display.getDefault().getSystemColor(SWT.COLOR_GRAY);
+ else
+ return null;
+ }
+
+ public Font getFont(Object element) {
+ if (element == LOADING_LABEL)
+ return JFaceResources.getFontRegistry().getItalic(
+ JFaceResources.DIALOG_FONT);
+ else
+ return null;
+ }
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/NewScratchbox2TargetWizard.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/NewScratchbox2TargetWizard.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/NewScratchbox2TargetWizard.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,402 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raul Herbster (UFCG) - initial API and implementation
+ * Carolina Nogueira de Souza (UFCG) - initial API and implementation
+ * Ed Swartz (Nokia)
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2.ui.wizard;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.*;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.*;
+import org.maemo.esbox.internal.api.scratchbox.ui.wizards.*;
+import org.maemo.esbox.internal.scratchbox.sb2.Activator;
+import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.scratchbox.sb2.sdk.IScratchbox2SDK;
+import org.maemo.esbox.scratchbox.sb2.sdk.MaemoRootstrap;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.ErrorLogger;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.internal.api.maemosdk.ui.wizards.sbrsh.SbrshConfigurationNFSServer;
+import org.maemo.mica.internal.api.maemosdk.ui.wizards.sbrsh.SbrshConfigurationTargetDevice;
+
+import java.lang.reflect.InvocationTargetException;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.text.MessageFormat;
+import java.util.List;
+
+/**
+ * The target wizard provides a easy way to create a target for Scratchbox. As
+ * Scratchbox target configuration, the user can configure your target.
+ *
+ */
+public class NewScratchbox2TargetWizard extends Wizard implements INewWizard {
+
+ protected WizardPage targetNamePage;
+ protected WizardPage compilerNamePage;
+ protected WizardPage cpuMethodName;
+ protected WizardPage sbrshConfigTargetDevice;
+ protected WizardPage sbrshConfigNFSServer;
+ protected IProject generatedProject;
+
+ private IScratchbox2SDK sdk;
+
+ private WizardPage maemoRootstrapPage;
+
+ protected ISDKTarget createdTarget;
+
+ private void initialize() {
+ setNeedsProgressMonitor(true);
+ setWindowTitle("New Scratchbox 2 Target");
+ ImageDescriptor image = Activator
+ .getImageDescriptor("./icons/full/wizban/newtarget_wiz.gif");
+ setDefaultPageImageDescriptor(image);
+ initPages();
+ }
+
+ /**
+ * Constructs a new target wizard for the given SDK (from the target
+ * configuration page)
+ *
+ * @param sdk
+ */
+ public NewScratchbox2TargetWizard(IScratchbox2SDK sdk) {
+ super();
+ this.sdk = sdk;
+ initialize();
+ }
+
+ /**
+ * Inicializes the content of the pages.
+ */
+ private void initPages() {
+ if (sdk != null) {
+ maemoRootstrapPage = new TargetWizardRootstrapSb2Page(sdk);
+ addPage(maemoRootstrapPage);
+ targetNamePage = TargetWizardPageFactory.getInstance()
+ .createNamePage(sdk);
+ addPage(targetNamePage);
+ compilerNamePage = TargetWizardPageFactory.getInstance()
+ .createCompilerPage(sdk);
+ addPage(compilerNamePage);
+ cpuMethodName = TargetWizardPageFactory.getInstance()
+ .createCPUMethod(sdk);
+ addPage(cpuMethodName);
+ sbrshConfigTargetDevice = TargetWizardPageFactory.getInstance()
+ .createSbrshConfigDeviceTargetPage();
+ addPage(sbrshConfigTargetDevice);
+ sbrshConfigNFSServer = TargetWizardPageFactory.getInstance()
+ .createSbrshConfigNFSSServer();
+ addPage(sbrshConfigNFSServer);
+ } else {
+ addPage(TargetWizardPageFactory.getInstance()
+ .createBadInstallationPage());
+ }
+ }
+
+ public boolean canFinish() {
+ if (sdk == null)
+ return false;
+
+ boolean nonCustomRootstrap = true;
+ if (maemoRootstrapPage != null)
+ nonCustomRootstrap = ((TargetWizardRootstrapSb2Page) maemoRootstrapPage)
+ .canFinish();
+ boolean cpuPage = ((TargetWizardCPUMethod) cpuMethodName).canFinish();
+ boolean configDevice = ((SbrshConfigurationTargetDevice) sbrshConfigTargetDevice)
+ .canFinish();
+ boolean NFSServer = ((SbrshConfigurationNFSServer) sbrshConfigNFSServer)
+ .canFinish();
+ boolean sbrshConfigAccepted = ((TargetWizardCPUMethod) cpuMethodName)
+ .getSbrshConfigure();
+
+ if (!sbrshConfigAccepted && (nonCustomRootstrap || cpuPage))
+ return true;
+ if (sbrshConfigAccepted && NFSServer && configDevice)
+ return true;
+
+ return false;
+ }
+
+ @Override
+ public IWizardPage getNextPage(IWizardPage page) {
+ if (page == maemoRootstrapPage) {
+ boolean nonCustomRootstrap = ((TargetWizardRootstrapSb2Page) maemoRootstrapPage)
+ .canFinish();
+ if (nonCustomRootstrap)
+ return null;
+ else
+ return super.getNextPage(page);
+ }
+ if (page == cpuMethodName) {
+ boolean sbrshConfigAccepted = ((TargetWizardCPUMethod) cpuMethodName)
+ .getSbrshConfigure();
+ if (!sbrshConfigAccepted) // user does not want to configure sbrsh
+ return null;
+ else
+ // user wants to configure sbrsh
+ return super.getNextPage(page);
+ }
+ return super.getNextPage(page);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.IWizard#performFinish()
+ */
+ public boolean performFinish() {
+ if (getRootstrap() != null) {
+ if (!setupTargetFromRootstrap())
+ return false;
+ } else {
+ if (!setupTargetFromScratch())
+ return false;
+ }
+
+ boolean sbrshConfigSelected = ((TargetWizardCPUMethod) cpuMethodName)
+ .getSbrshConfigure();
+ if (sbrshConfigSelected) {
+ configureSbrshService();
+ showsDialog();
+ }
+
+ return true;
+ }
+
+ private boolean setupTargetFromScratch() {
+ String targetName;
+ // in this mode, construct a target from the user's settings
+ targetName = getTargetNameSelected();
+ String compilerName = getCompilerNameSelected();
+ String cpuMethod = getCputranspSelected();
+ try {
+ sdk.createTarget(targetName, compilerName, null, cpuMethod);
+ createdTarget = sdk.findSDKTarget(targetName);
+ return true;
+ } catch (ESboxException e) {
+ ErrorLogger errorLogger = Activator.getErrorLogger();
+ errorLogger.logAndShowError("Cannot get create target "
+ + targetName, e);
+ return false;
+ }
+ }
+
+ private boolean setupTargetFromRootstrap() {
+ String targetName;
+ // in this mode, make a predefined target from a maemo rootstrap
+ targetName = getRootstrap().getName();
+ boolean create = true;
+
+ if (true) {
+ // see if the rootstrap (not necessarily the target) already exists,
+ // and ask user, in case this will overwrite their customizations
+ try {
+ List<String> installedRootstraps = sdk
+ .getInstalledMaemoRootstraps();
+ if (installedRootstraps.contains(targetName)) {
+ create = MessageDialog
+ .openConfirm(
+ getShell(),
+ "Reinstall rootstrap?",
+ MessageFormat
+ .format(
+ "The rootstrap ''{0}'' appears to be already installed, though it may be disconnected from scratchbox.\n\n"
+ + "At this time, we can't recreate a target for this rootstrap, but "
+ + "you could do it manually with 'sb2-init'.\n\n"
+ + "Do you want to overwrite the rootstrap?",
+ targetName));
+ }
+ } catch (ESboxException e) {
+ ErrorLogger errorLogger = Activator.getErrorLogger();
+ errorLogger.logError("Cannot detect installed rootstraps", e);
+ }
+ }
+
+ if (create) {
+ try {
+ createRootstrap(targetName, useHostTools());
+ } catch (ESboxException e) {
+ ErrorLogger errorLogger = Activator.getErrorLogger();
+ errorLogger.logAndShowError(
+ "Cannot get create rootstrap target " + targetName, e);
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private void createRootstrap(final String targetName,
+ final boolean useHostTools) throws ScratchboxException {
+ try {
+ getContainer().run(true, true, new IRunnableWithProgress() {
+
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+ monitor.beginTask("Creating rootstrap",
+ IProgressMonitor.UNKNOWN);
+ try {
+ sdk.createRootstrapTarget(targetName, useHostTools,
+ true, new SubProgressMonitor(monitor, 1));
+ createdTarget = sdk.findSDKTarget(targetName);
+ } catch (ESboxException e) {
+ throw new InvocationTargetException(e);
+ }
+ monitor.done();
+ }
+
+ });
+ } catch (InvocationTargetException e) {
+ if (e.getCause() instanceof ScratchboxException)
+ throw (ScratchboxException) e.getCause();
+ else
+ throw new ScratchboxException(e);
+ } catch (InterruptedException e) {
+ throw new ScratchboxException(e);
+ }
+ }
+
+ private MaemoRootstrap getRootstrap() {
+ return ((TargetWizardRootstrapSb2Page) maemoRootstrapPage)
+ .getRootstrap();
+ }
+
+ private boolean useHostTools() {
+ return ((TargetWizardRootstrapSb2Page) maemoRootstrapPage)
+ .useHostTools();
+ }
+
+ /**
+ * Return the name of the target to be created.
+ *
+ * @return the name of the target to be created.
+ */
+ private String getTargetNameSelected() {
+ return ((TargetWizardNamePage) targetNamePage).getTextControl()
+ .getText();
+ }
+
+ /**
+ * Return the compiler name of the target to be created.
+ *
+ * @return the compiler name of the target to be created.
+ */
+ private String getCompilerNameSelected() {
+ TableItem item = ((TargetWizardCompilerPage) compilerNamePage)
+ .getTableControl().getSelection()[0];
+ return item.getText();
+ }
+
+ /**
+ * Return the cputransp name of the target to be created.
+ *
+ * @return the cputransp name of the target to be created.
+ */
+ private String getCputranspSelected() {
+ TableItem item = ((TargetWizardCPUMethod) cpuMethodName).getTable()
+ .getSelection()[0];
+ return item.getText();
+ }
+
+ /**
+ * Configure sbrsh service.
+ */
+ private void configureSbrshService() {
+ String targetName = getTargetNameSelected();
+ String deviceTargetAddr = ((SbrshConfigurationTargetDevice) sbrshConfigTargetDevice)
+ .getTargetDeviceAddr();
+ String nfsHostname = ((SbrshConfigurationNFSServer) sbrshConfigNFSServer)
+ .getNFSHostname();
+
+ try {
+ sdk.configureSbrsh(targetName, deviceTargetAddr, nfsHostname);
+ } catch (ESboxException e) {
+ ErrorLogger errorLogger = Activator.getErrorLogger();
+ errorLogger.logAndShowError("Cannot configure sbrsh", e);
+ }
+ }
+
+ /**
+ * Add user at access list of the sbrshd running at the target device.
+ */
+ private void addUser() {
+ String deviceTargetIP = ((SbrshConfigurationTargetDevice) sbrshConfigTargetDevice)
+ .getTargetDeviceIP();
+ String username = System.getProperty("user.name");
+ ErrorLogger errorLogger = Activator.getErrorLogger();
+
+ try {
+ String localAddr = getLocalIP();
+ sdk.addSbrshAccessList(deviceTargetIP, username, localAddr);
+ } catch (ESboxException e) {
+ errorLogger
+ .logAndShowError(
+ "Cannot add user to the access list of sbrshd at the target device",
+ e);
+ } catch (UnknownHostException e) {
+ errorLogger.logAndShowError("Cannot get local IP address", e);
+ }
+ }
+
+ /**
+ * Shows the dialog to ask the user if s/he wants to add his/herself to the
+ * acess list of the sbrshd.
+ */
+ private void showsDialog() {
+ String deviceTargetAddr = ((SbrshConfigurationTargetDevice) sbrshConfigTargetDevice)
+ .getTargetDeviceIP();
+ String text = "Do you want to add yourself to the access list of the sbrshd running on target device? \n";
+ text += "(This requires that "
+ + deviceTargetAddr
+ + " has ssh daemon running and sbrshd already installed, and that you have root access).";
+ boolean userAddedAtAccessList = MessageDialog.openQuestion(getShell(),
+ "Scratchbox Configuration", text);
+ if (userAddedAtAccessList) {
+ addUser();
+ }
+ }
+
+ /**
+ * Get the local IP address.
+ *
+ * @return the local IP address.
+ * @throws UnknownHostException
+ */
+ private String getLocalIP() throws UnknownHostException {
+ return InetAddress.getLocalHost().getHostAddress();
+ }
+
+ /**
+ * We will accept the selection in the workbench to see if we can initialize
+ * from it.
+ *
+ * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ }
+
+ /**
+ * Get the target created. Only valid after wizard dialog completes.
+ *
+ * @return newly created ISDKTarget or <code>null</code>
+ */
+ public ISDKTarget getCreatedTarget() {
+ return createdTarget;
+ }
+
+}
\ No newline at end of file
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/TargetWizardRootstrapSb2Page.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/TargetWizardRootstrapSb2Page.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/TargetWizardRootstrapSb2Page.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,210 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ * Petr Baranov (Nokia)
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.scratchbox.sb2.ui.wizard;
+
+import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.*;
+import org.maemo.esbox.internal.scratchbox.sb2.core.Scratchbox2SDK;
+import org.maemo.esbox.scratchbox.sb2.sdk.IScratchbox2SDK;
+import org.maemo.esbox.scratchbox.sb2.sdk.MaemoRootstrap;
+import org.maemo.mica.internal.api.maemosdk.ui.wizards.IValidatePage;
+
+/**
+ * This page allows the user to select a rootstrap (which defines the target
+ * name, compiler, devkits, and cpu method all at once) for use with sb2, or to
+ * explicitly select to configure all the aspects himself.
+ *
+ * @author eswartz
+ *
+ */
+public class TargetWizardRootstrapSb2Page extends WizardPage implements
+ IValidatePage {
+
+ protected TreeViewer rootstrapTargetViewer;
+ protected Text text;
+ /* private */IScratchbox2SDK sdk; // in case we use it later
+ protected Object selection;
+ private MaemoRootstrapContentLabelProvider provider;
+ private Button showExistingTargets;
+ private Button useHostTools;
+
+ /**
+ * Constructs a NewTargetWizardNamePage.
+ */
+ protected TargetWizardRootstrapSb2Page(IScratchbox2SDK sdk) {
+ super("Target Name");
+ this.sdk = sdk;
+ if (!(sdk instanceof Scratchbox2SDK)) {
+ throw new IllegalArgumentException(
+ "This page only expects a scratchbox 2 SDK");
+ }
+ setTitle("Select maemo SDK+ Rootstrap");
+ setDescription("Select the maemo rootstrap to install, or manually configure a target.");
+ setPageComplete(false);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
+ * .Composite)
+ */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(1, false));
+
+ Label label = new Label(composite, SWT.LEFT);
+ label.setText("Select a rootstrap:");
+
+ rootstrapTargetViewer = new TreeViewer(composite, SWT.SINGLE
+ | SWT.BORDER);
+ rootstrapTargetViewer.getTree().setLayoutData(
+ new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ showExistingTargets = new Button(composite, SWT.CHECK);
+ showExistingTargets.setText("Show existing targets");
+ showExistingTargets.setSelection(false);
+ showExistingTargets
+ .setToolTipText("If checked, rootstraps with names matching existing targets will be shown. This is the only way to reinstall a target.");
+
+ useHostTools = new Button(composite, SWT.CHECK);
+ useHostTools.setText("Use host's build tools");
+ useHostTools.setSelection(false);
+ useHostTools
+ .setToolTipText("If checked, configure the rootstrap to use the host versions of autotools, bison, flex, docbook, etc. instead of standard versions (c.f. devkits in scratchbox 1). We recommend leaving this unchecked and invoking maemo-tools to install official build tools.");
+
+ // / setup rootstrap target tree
+
+ provider = new MaemoRootstrapContentLabelProvider(sdk);
+ rootstrapTargetViewer.setContentProvider(provider);
+ rootstrapTargetViewer.setLabelProvider(provider);
+
+ rootstrapTargetViewer
+ .addSelectionChangedListener(new ISelectionChangedListener() {
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ selection = ((IStructuredSelection) event
+ .getSelection()).getFirstElement();
+ validatePage();
+ }
+
+ });
+
+ provider.addListener(new ILabelProviderListener() {
+
+ public void labelProviderChanged(LabelProviderChangedEvent event) {
+ rootstrapTargetViewer.refresh();
+ }
+
+ });
+
+ rootstrapTargetViewer.getTree().setLinesVisible(true);
+ rootstrapTargetViewer.getTree().setHeaderVisible(true);
+
+ TreeColumn nameColumn = new TreeColumn(rootstrapTargetViewer.getTree(),
+ SWT.LEFT);
+ nameColumn.setText("Target Name");
+ nameColumn.setWidth(200);
+ nameColumn.setResizable(true);
+
+ TreeColumn archColumn = new TreeColumn(rootstrapTargetViewer.getTree(),
+ SWT.LEFT);
+ archColumn.setText("Architecture");
+ archColumn.setWidth(100);
+ archColumn.setResizable(true);
+
+ TreeColumn descColumn = new TreeColumn(rootstrapTargetViewer.getTree(),
+ SWT.LEFT);
+ descColumn.setText("Description");
+ descColumn.setWidth(200);
+ descColumn.setResizable(true);
+
+ rootstrapTargetViewer.setInput(new Object());
+
+ rootstrapTargetViewer.setSelection(StructuredSelection.EMPTY);
+
+ showExistingTargets.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ updateViewerFilters();
+ }
+ });
+
+ updateViewerFilters();
+ setControl(composite);
+ }
+
+ protected void updateViewerFilters() {
+ if (!showExistingTargets.getSelection()) {
+ rootstrapTargetViewer
+ .setFilters(new ViewerFilter[] { new ViewerFilter() {
+
+ @Override
+ public boolean select(Viewer viewer,
+ Object parentElement, Object element) {
+ if (element instanceof MaemoRootstrap) {
+ MaemoRootstrap rootstrap = (MaemoRootstrap) element;
+ if (sdk.findSDKTarget(rootstrap.getName()) != null)
+ return false;
+ }
+ return true;
+ }
+
+ } });
+ } else {
+ rootstrapTargetViewer.setFilters(new ViewerFilter[0]);
+ }
+
+ rootstrapTargetViewer.refresh();
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * br.edu.ufcg.dee.omapsdk.properties.target.wizard.pages.ValidateWizardPage
+ * #perfomeAction()
+ */
+ public boolean validatePage() {
+ setPageComplete(selection instanceof MaemoRootstrap
+ || selection == MaemoRootstrapContentLabelProvider.NO_ROOTSTRAP);
+ return true;
+ }
+
+ public boolean canFinish() {
+ return selection instanceof MaemoRootstrap;
+ }
+
+ public MaemoRootstrap getRootstrap() {
+ if (!(selection instanceof MaemoRootstrap))
+ return null;
+ return (MaemoRootstrap) selection;
+ }
+
+ public boolean isShowingExisting() {
+ return showExistingTargets.getSelection();
+ }
+
+ public boolean useHostTools() {
+ return useHostTools.getSelection();
+ }
+
+}
\ No newline at end of file
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk/IScratchbox2SDK.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk/IScratchbox2SDK.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk/IScratchbox2SDK.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Petr Baranov (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.scratchbox.sb2.sdk;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDK;
+import org.maemo.mica.common.core.ESboxException;
+import org.maemo.mica.common.core.machine.IMachine;
+
+public interface IScratchbox2SDK extends IScratchboxSDK {
+
+ /**
+ * Map<String,Map<String, String>> of sb2 target names to a map of the
+ * target directory to host directory path mappings
+ */
+ static final String SB2_TARGET_TO_PATH_MAPPINGS_MAP = "sb2_target_to_path_mappings_map";
+ /** Map<String,String> of sb2 target names to rootstrap paths */
+ static final String SB2_TARGET_TO_ROOTSTRAP_MAP = "sb2_target_to_rootstrap_map";
+
+ /**
+ * @return
+ */
+ public IPath getScratchbox2ConfigDirectory();
+
+ /**
+ * Create a new rootstrap target for Scratchbox 2. The target is named after
+ * a maemo-rootstrap available target.
+ *
+ * @param targetName
+ * the name of the new target.
+ * @param useHostTools
+ * if true, use the host toolchain rather than installing devkits
+ * in the rootstrap
+ * @param force
+ * if true, then overwrite any existing rootstrap; if false, then
+ * let the user choose (in the console :/) whether to overwrite
+ * or keep an existing one
+ * @return true if succeeded, false if failed
+ * @throws ESboxException
+ * if some problem related to Scratchbox communication occurs.
+ */
+ public boolean createRootstrapTarget(String targetName,
+ boolean useHostTools, boolean force, IProgressMonitor monitor)
+ throws ESboxException;
+
+ /**
+ * Create a new rootstrap target for Scratchbox 2. The target is named after
+ * a maemo-rootstrap available target.
+ *
+ * @param targetName
+ * the name of the new target.
+ * @param force
+ * if true, then overwrite any existing rootstrap; if false, then
+ * let the user choose (in the console :/) whether to overwrite
+ * or keep an existing one
+ * @return true if succeeded, false if failed
+ * @throws ESboxException
+ * if some problem related to Scratchbox communication occurs.
+ */
+ public boolean removeRootstrap(String targetName, boolean force,
+ IProgressMonitor monitor) throws ESboxException;
+
+ /**
+ * Get the names of rootstraps already installed. This may inclue those that
+ * do not have targets associated.
+ *
+ * @param sdk
+ * the SDK to check
+ * @return List, never null
+ * @throws ESboxException
+ */
+ public List<String> getInstalledMaemoRootstraps() throws ESboxException;
+
+ /**
+ * Get the MaemoRootstrap items available for installation. This includes
+ * any that might already be defined.
+ *
+ * @return List, never null
+ * @throws ESboxException
+ */
+ public List<MaemoRootstrap> getAvailableMaemoRootstraps(IMachine machine)
+ throws ESboxException;
+
+}
Added: branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk/MaemoRootstrap.java
===================================================================
--- branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk/MaemoRootstrap.java (rev 0)
+++ branches/micaSplit/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk/MaemoRootstrap.java 2008-10-23 12:55:05 UTC (rev 886)
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.scratchbox.sb2.sdk;
+
+/**
+ * The data associated with a maemo SDK+ rootstrap
+ *
+ * @author eswartz
+ *
+ */
+public class MaemoRootstrap {
+ private final String name;
+ private final String architecture;
+ private final String description;
+
+ public MaemoRootstrap(String name, String architecture, String description) {
+ this.name = name;
+ this.architecture = architecture;
+ this.description = description;
+
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getArchitecture() {
+ return architecture;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((architecture == null) ? 0 : architecture.hashCode());
+ result = prime * result
+ + ((description == null) ? 0 : description.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final MaemoRootstrap other = (MaemoRootstrap) obj;
+ if (architecture == null) {
+ if (other.architecture != null)
+ return false;
+ } else if (!architecture.equals(other.architecture))
+ return false;
+ if (description == null) {
+ if (other.description != null)
+ return false;
+ } else if (!description.equals(other.description))
+ return false;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
+
+}
More information about the Esbox-commits
mailing list