Blackberry Phonegap load device showing error - blackberry

I am developing the blackberry phonegap application. I have set all environment required to build the application. I am using command prompt to debug the application when i build the application it build successfully. But while loading the device it causing error as follows.
C:\bbtest>ant blackberry load-device
Buildfile: C:\bbtest\build.xml
blackberry:
load-device:
generate-cod-name:
[echo] Generated name: cordovaExample.cod
clean:
[delete] Deleting directory C:\bbtest\build
package-app:
[mkdir] Created dir: C:\bbtest\build\widget
[copy] Copying 24 files to C:\bbtest\build\widget
[zip] Building zip: C:\bbtest\build\cordovaExample.zip
load-device:
[exec] [INFO] Parsing command line options
[exec] [INFO] Parsing bbwp.properties
[exec] [INFO] Validating application archive
[exec] [INFO] Parsing config.xml
[exec] [INFO] Populating application source
[exec] [INFO] Compiling BlackBerry WebWorks applicatio
n
[exec] [INFO] Starting signing tool
[exec] [INFO] Signing complete
[exec] [INFO] Generating output files
[exec] [INFO] BlackBerry WebWorks application packagin
g complete
[exec] RIM Wireless Handheld Java Loader
[exec] Copyright 2001-2009 Research In Motion Limited
[exec] Connecting to device...debug: HRESULT error during Open: 80040154
[exec] Error: unable to open port
BUILD FAILED
C:\bbtest\build.xml:49: The following error occurred while executing this line:
C:\bbtest\blackberry.xml:53: exec returned: 3
Total time: 53 seconds
C:\bbtest>
Any Idea why this is happing any help would be appreciated.

Its hard to nail down the problem with that information but I suspect you have a problem with "target name" in your xml.
Make sure the load-device is correctly targeted in your blackberry.xml as shown.
<target name="load-device" depends="package-app">
<bbwp code-sign="true" />
<exec executable="${javaloader}" dir="." failonerror="true">
<arg value="-u" />
<arg value="-w${properties.blackberry.sim.password}" />
<arg value="load" />
<arg file="${build.dir}/StandardInstall/${cod.name}.cod" />
</exec>
</target>
Also make sure that your directories are properly set in project.properties.
blackberry.bbwp.dir=C:\\TheBlackBerryWebWorksSDK
blackberry.sim.dir=C:\\TheEclipseBlackBerry\\plugins\\net.rim.ejde.componentpack5.0.0_5.0.0.25\\components\\simulator
blackberry.mds.dir=C:\\TheBlackBerryWebWorksSDK\\mds

I think that you may not have BlackBerry Desktop Manager installed. You can download this from http://uk.blackberry.com/software/desktop/desktop-pc.html

This error is also thrown when using the incorrect deployment command.
In my case I tried to deploy my application to a BB10 device using ant blackberry load-device instead of ant qnx load-device.
Here's a snippet from the documentation:
BlackBerry 10 (QNX) - ant qnx load-device
BlackBerry PlayBook - ant playbook load-device
BlackBerry Smartphone (OS5-7) - ant blackberry load-device
See http://cordova.apache.org/docs/en/2.5.0/guide_getting-started_blackberry_index.md.html

Related

flexmojos-maven-plugin:7.0.1:test-compile build failure at net.flexmojos.oss.unitestingsupport.TestApplication

I have a project with Flexmojos 4.0-beta-7 and multiple modules.
There is an artifact with swc packaging and some tests.
During maven install phase it creates the following MXML file
/target/test-classes/TestRunner.mxml
<?xml version="1.0" encoding="utf-8"?>
<unitestingsupport:TestApplication
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:unitestingsupport="net.flexmojos.oss.unitestingsupport.*"
layout="absolute"
initialize="init()"
port="59896"
controlPort="59895"
>
<mx:Script>
<![CDATA[
import projekt.service.command.CommandServiceTest; CommandServiceTest;
import projekt.service.command.impl.CommandTest; CommandTest;
import projekt.service.console.ConsoleLogTargetTest; ConsoleLogTargetTest;
import projekt.service.dump.dumper.ServiceDumperTest; ServiceDumperTest;
private function init():void {
addTest( CommandServiceTest);
addTest( CommandTest);
addTest( ConsoleLogTargetTest);
addTest( ServiceDumperTest);
}
]]>
</mx:Script>
</unitestingsupport:TestApplication>
So the phase on Flexmojos 4.0-beta-7 runs fine, producing the following output.
[exec] [INFO] --- flexmojos-maven-plugin:4.0-beta-7:test-compile (default-test-compile) # Projekt ---
[exec] [INFO] Flexmojos 4.0-beta-7
[exec] [INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[exec] [INFO] Compiling test class: [projekt.service.command.CommandServiceTest, projekt.service.command.impl.CommandTest, projekt.service.console.ConsoleLogTargetTest, projekt.service.dump.dumper.ServiceDumperTest]
[exec] Writing configuration dump to C:\Users\Uzer\Documents\Projekt\target\test-classes\TestRunner-configs.xml
[exec] C:\Users\Uzer\Documents\Projekt\target\test-classes\TestRunner.swf (1181091 bytes)
[exec] [INFO]
[exec] [INFO] --- flexmojos-maven-plugin:4.0-beta-7:test-run (default-test-run) # Projekt ---
But then I have had to upgrade it to Flexmojos 7.0.1 because of FLEXMOJOS-886
https://flexmojos.atlassian.net/browse/FLEXMOJOS-886
Unfortunately, it breaks the phase, producing the following output.
Initially it begins the same way
[exec] [INFO] --- flexmojos-maven-plugin:7.0.1:test-compile (default-test-compile) # Projekt ---
[exec] [INFO] Flexmojos 7.0.1
[exec] [INFO] GPL License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[exec] [INFO] Compiling test class: [projekt.service.command.CommandServiceTest, projekt.service.command.impl.CommandTest, projekt.service.console.ConsoleLogTargetTest, projekt.service.dump.dumper.ServiceDumperTest]
But then it fails with the following messages.
Writing configuration dump to C:\Users\Uzer\Documents\Projekt\target\test-classes\TestRunner-configs.xml
C:\Users\Uzer\Documents\Projekt\target\test-classes\TestRunner.mxml(30): Error: Cannot resolve attribute 'layout' for component type net.flexmojos.oss.unitestingsupport.TestApplication.
C:\Users\Uzer\Documents\Projekt\target\test-classes\TestRunner.mxml(30): Error: Cannot resolve attribute 'initialize' for component type net.flexmojos.oss.unitestingsupport.TestApplication.
C:\Users\Uzer\Documents\Projekt\target\test-classes\TestRunner.mxml(30): Error: Cannot resolve attribute 'port' for component type net.flexmojos.oss.unitestingsupport.TestApplication.
C:\Users\Uzer\Documents\Projekt\target\test-classes\TestRunner.mxml(30): Error: Cannot resolve attribute 'controlPort' for component type net.flexmojos.oss.unitestingsupport.TestApplication.
How to fix it and make it work with Flexmojos 7.0.1, any ideas?

CruiseControl.net ndk-build on Windows 64bit without Cygwin

Latest Android NDK (version 8) allows to call ndk-build without additional cygwin installed.
My question is: can I plug this into CruiseControl.Net for periodical native build?
I assume that most likely I would need to use Ant as a build method and then add it to ccnet server config.
So the questions are:
How to call ndk-build.cmd from an Ant command
How to configure build.xml file?
I tried several approaches, but all of those failed. Could you give me some clues if it is possible at all?
I ran into the same problem (the CreateProcess failures, etc) when trying to invoke "ndk-build.cmd" directly from build.xml, using CC.net on Windows. I figured out how to get this to work, and so I felt compelled to share my solution.
First, create a 1-line Windows command file as follows (I named it "ndkwrapper.cmd"):
sh ndkwrap.sh %1 %2 %3
Next, create a simple bash shell script as follows (named "ndkwrap.sh"):
#!/usr/bin/sh
# Wrapper around ndk-build script for Windows
#
NDK_PROJECT_PATH=/cygdrive/c/workspace/agnc_android
export NDK_PROJECT_PATH
/cygdrive/c/Android/android-ndk-r8b/ndk-build $1 $2 $3
Of course, your exact paths (for your workspace and NDK directories) may be different, but note, in particular, that "/cygdrive/c" refers to "C:".
One very important step here, after you create the script above, is to convert the line endings from Windows to UNIX. You can do this with a utility called "dos2unix.exe" which is freely available. I don't remember where I got it, but it was part of some open source package of GNU/Linux tools ported to Windows. (Google on "UNIX file utilities for Windows".) If you don't convert the line endings, then sh or bash will have trouble reading the script, and you'll get all kinds of erros about "\r" ...
So, to invoke the equivalent of "ndk-build.cmd clean", for example, you'd type "ndkwrapper.cmd clean" to delete your intermediate and output NDK-related build files, in preparation for a full NDK build.
In your build.xml file for CC.net on Windows, you can invoke the NDK makefile as follows:
<tasks>
<exec>
<executable>cmd.exe</executable>
<baseDirectory>C:\Android</baseDirectory>
<buildArgs>/C ndkwrapper.cmd clean</buildArgs>
</exec>
Hope this helps!
Ben
i observed problems with running ndk-build as an CCNET task as well.
It took me a while, but at the end i noticed, that you have to provide HOST_OS and HOST_ARCH as ndk-build parameters to let it run.
<exec>
<executable>cmd</executable>
<buildArgs>/C ndk-build HOST_OS=windows HOST_ARCH=x86 -B NDK_PROJECT_PATH=[PROJECT] APP_BUILD_SCRIPT=[ANDROIDMKFILE] NDK_APPLICATION_MK=[APPLICATIONMKFILE] NDK_LOG=1</buildArgs>
<buildTimeoutSeconds>120</buildTimeoutSeconds>
</exec>
hope it helps anyone to save time.
Ok I got some progress, I am able to build the jni code via ant or nant but in both cases plugging it to the cc.net server config gives me strane error:
but now CC.net gives me strange errors:
<builderror>
<type>NAnt.Core.BuildException</type>
<message><![CDATA[External Program Failed: G:\\android-ndk-r8b\\ndk-build.cmd (return code was 2)]]></message>
<location>
<filename>G:/MYPath/project.build</filename>
<linenumber>7</linenumber>
<columnnumber>4</columnnumber>
</location>
<stacktrace><![CDATA[ at NAnt.Core.Tasks.ExternalProgramBase.ExecuteTask()
at NAnt.Core.Tasks.ExecTask.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.Target.Execute()
at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies)
at NAnt.Core.Project.Execute()
at NAnt.Core.Project.Run()]]></stacktrace>
</builderror>
</failure>
<duration>296.40000000000003</duration>
</buildresults>Buildfile: file:///G:/MYPath/project.build
Target framework: Microsoft .NET Framework 4.0
Target(s) specified: build
clean:
[echo] Starting Android ndk CLEAN ...
[exec] Android NDK: Unable to determine HOST_OS from uname -s:
[exec] Android NDK: Please define HOST_OS in your environment.
[exec] process_begin: CreateProcess(NULL, uname -s, ...) failed.
[exec] G:/android-ndk-r8b/build/core/init.mk:131: *** Android NDK: Aborting. . Stop.
BUILD FAILED - 0 non-fatal error(s), 2 warning(s)
My project in cc.net config:
<project>
<name>MY_PROJECT_NAME</name>
<workingDirectory>PATH_TO_MY_PROJECT</workingDirectory>
<tasks>
<nant>
<executable>G:\nant-0.92\bin\Nant.exe</executable>
<baseDirectory>PATH_TO_MY_PROJECT</baseDirectory>
<buildFile>MYPROJECTNAME.build</buildFile>
<buildArgs>build</buildArgs>
<buildTimeoutSeconds>1200</buildTimeoutSeconds>
</nant>
</tasks>
</project>
And my NAnt build file:
<project name="my name" default="build" basedir=".">
<description>My project Build Files.</description>
<target name="clean" description="remove all generated files">
<echo message="Starting Android ndk CLEAN ..."/>
<exec program="G:\\android-ndk-r8b\\ndk-build.cmd" failonerror="true"
basedir="MY PROJECT PATH">
<arg value="clean" />
</exec>
<echo message="Android ndk CLEAN done."/>
</target>
<target name="build" description="remove all generated files" depends="clean">
<echo message="Starting Android ndk BUILD ..."/>
<exec program="G:/android-ndk-r8b/ndk-build.cmd" failonerror="true" />
<echo message="Android ndk BUILD done."/>
</target>
</project>
As I said I can run a Nant.exe for my project and it cleans and build correctly.
It looks like the cc.net tries to run the other ndk-build commend which is used for linux and is missing some commands as uname.
Do you have any idea what cI could be doing wrong ?
The original question is asking about ant builds. This answer is related to a problem in CC.NET and ant and gradle builds are going to be affected in the same way.
We are using gradle and with some custom gradle tasks it is possible to compile the native code of your project as well by calling ndk-build.cmd (from a path that has no spaces in it).
After the gradle file is prepared properly shell initiated gradle builds will work but cc.net initiated builds will fail.
Our CC.NET task is defined as follows:
<exec executable=".\gradlew.bat">
<baseDirectory>$(projSrcDir)</baseDirectory>
<buildArgs>clean assemblePlayRelease assembleProRelease</buildArgs>
<buildTimeoutSeconds>900</buildTimeoutSeconds>
</exec>
The problem is related to a CC.NET bug that causes the shell variable names to be in lower case. Windows shell scripts do not care about the case of shell variable names but because the NDK fires up make variable case becomes an issue. The init.mk make file that is part of the build process relies on shell variable names to identify the host OS type. In particular the shell variable OS. Normally the OS value is defined like this:
OS=Windows_NT
But when the variable is passed to gradle from CC.NET it gets transformed into this:
os=Windows_NT
This causes the detection mechanism in init.mk to fail and tries to execute the unix detection sequence and looks for the Unix uname utility that is not present on Windows resulting in:
Android NDK: Unable to determine HOST_OS from uname -s:
Android NDK: Please define HOST_OS in your environment.
make.exe: Entering directory `D:/CC.NET/svncheckout/pes/src/project/src/main/jni'
make.exe: Leaving directory `D:/CC.NET/svncheckout/pes/src/project/src/main/jni'
And ultimately:
process_begin: CreateProcess(NULL, uname -s, ...) failed.
c:/ndk/build/core/init.mk:160: *** Android NDK: Aborting. . Stop.
FAILURE: Build failed with an exception.
The workaround is less then ideal but it gets the job done. The idea is to edit the ndk-build.cmd and change the case of the passed variables only when we are building from CC.NET.
Simply insert this code after the #echo off line in ndk-build.cmd:
IF DEFINED ccnetproject (
ECHO Applying Environment variable hack for CC.NET.
SET OS2=%os%
SET OS=
REM SET PATH=%path%
SET TEMP2=%temp%
SET TEMP=
)
IF DEFINED ccnetproject (
SET OS=%OS2%
SET OS2=
SET TEMP=%TEMP2%
SET TEMP2=
)
This script first makes temporary copies of values in the lower case OS and TEMP variables. Next it undefines them by clearing their values. An finally the reverse is done.
Two steps are needed because just saying
SET OS=%os%
doesn't do much since scripts are case insensitive. It first locates the OS variable, finds a lower case version and assigns its own value back to itself.
This was tested on CC.NET v1.6.7981.1, gradle v1.1.0 and Android NDK v10 (64bit).

Can't run "preverify.exe" using Ant's <exec> task

I am having trouble getting my Ant script (for BlackBerry build) to run the preverify.exe command & pass the correct parameters to it.
In the command prompt (Windows 7), this works 100% - the parameters as given work properly:
preverify -verbose -classpath C:\development\tools\bb-jde\jde5.0\components\lib\net_rim_api.jar -d build\classes\preverified build\classes\preverified build\classes\unverified
I tried to put this into my Ant script using the following target - trying to use the same parameters:
<target name="preverify">
<mkdir dir="${dest.dir}/classes/preverified" />
<exec executable="${jde.home}/bin/preverify">
<arg value="-verbose" />
<arg value="-classpath C:\development\tools\bb-jde\jde5.0\components\lib\net_rim_api.jar" />
<arg value="-d build\classes\preverified" />
<arg value="build\classes\unverified" />
</exec>
</target>
This does not work. I get the following error:
Illegal option
-classpath C:\development\tools\bb-jde\jde5.0\components\lib\net_rim_api.jar
this classpath was perfectly acceptable from the command line (often java commands accept JAR files as directories, since they are basically ZIP files).
How can I get Ant to send the correct parameters to this command, as in the command line version? There must be something about exec that I'm missing?
Here is the full Ant output from running this target in verbose mode, if it helps:
Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Trying the default build file: build.xml
Buildfile: C:\development\ant\test_using_javac_jar_preverify_then_rapc\Cobi\build.xml
Detected Java version: 1.6 in: C:\Java\jdk1.6.0_24\jre
Detected OS: Windows 7
parsing buildfile C:\development\ant\test_using_javac_jar_preverify_then_rapc\Cobi\build.xml with URI = file:/C:/development/ant/test_using_javac_jar_preverify_then_rapc/Cobi/build.xml
Project base dir set to: C:\development\ant\test_using_javac_jar_preverify_then_rapc\Cobi
parsing buildfile jar:file:/C:/development/tools/apache-ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/C:/development/tools/apache-ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
Importing file C:\development\ant\common\constants.xml from C:\development\ant\test_using_javac_jar_preverify_then_rapc\Cobi\build.xml
Overriding previous definition of reference to ant.projectHelper
parsing buildfile C:\development\ant\common\constants.xml with URI = file:/C:/development/ant/common/constants.xml
parsing buildfile jar:file:/C:/development/tools/bb-ant-tools/bb-ant-tools.jar!/bb-ant-defs.xml with URI = jar:file:/C:/development/tools/bb-ant-tools/bb-ant-tools.jar!/bb-ant-defs.xml from a zip file
Overriding previous definition of reference to ant.projectHelper
[property] Loading C:\development\ant\test_using_javac_jar_preverify_then_rapc\Cobi\project.properties
[property] Loading C:\development\ant\common\jde5.0.properties
[property] Loading C:\development\ant\common\common.properties
[pathconvert] Set property net_rim_api.jar.dos = C:\development\tools\bb-jde\jde5.0\components\lib\net_rim_api.jar
Build sequence for target(s) `preverify' is [preverify]
Complete build sequence is [preverify, javac, build, sign, clean, ]
preverify:
[mkdir] Skipping C:\development\ant\test_using_javac_jar_preverify_then_rapc\Cobi\build\classes\preverified because it already exists.
[exec] Current OS is Windows 7
[exec] Executing 'C:\development\tools\bb-jde\jde5.0\components\bin\preverify' with arguments:
[exec] '-verbose'
[exec] '-classpath C:\development\tools\bb-jde\jde5.0\components\lib\net_rim_api.jar'
[exec] '-d build\classes\preverified'
[exec] 'build\classes\unverified'
[exec]
[exec] The ' characters around the executable and arguments are
[exec] not part of the command.
[exec] preverify: Illegal option -classpath C:\development\tools\bb-jde\jde5.0\components\lib\net_rim_api.jar
[exec]
[exec] Usage: preverify [options] classnames|dirnames ...
[exec]
[exec] where options include:
[exec] -classpath <directories separated by ';'>
[exec] Directories in which to look for classes
[exec] -d <directory> Directory in which output is written (default is ./output/)
[exec] -cldc1.0 Checks for existence of language features prohibited
[exec] by CLDC 1.0 (native methods, floating point and finalizers)
[exec] -nofinalize No finalizers allowed
[exec] -nonative No native methods allowed
[exec] -nofp No floating point operations allowed
[exec] #<filename> Read command line arguments from a text file
[exec] Command line arguments must all be on a single line
[exec] Directory names must be enclosed in double quotes (")
[exec]
[exec] Result: 1
BUILD SUCCESSFUL
Total time: 1 second
This doesn't look like an ANT issue. The error message is being returned by the preverify command, proving that ANT is executing it...
I don't understand what this command is supposed to be doing, however the usage message gives a hint as to the root cause:
[exec] Usage: preverify [options] classnames|dirnames ...
[exec]
[exec] where options include:
[exec] -classpath <directories separated by ';'>
[exec] Directories in which to look for classes
You haven't specified a list of directories as the "classpath" parameter.... You've supplied a jar file. Is the command able support jar files?
The way you are passing the parameters is incorrect. The space between the -classpath tag, and the JAR name is not allowed.
You must break that line (and the -d below it) onto 2 lines. This works:
<exec executable="${jde.home}/bin/preverify">
<arg value="-verbose" />
<!-- classpath to the RIM api -->
<arg value="-classpath" />
<arg value="C:\development\tools\bb-jde\jde5.0\components\lib\net_rim_api.jar" />
<!-- destination folder -->
<arg value="-d" />
<arg value="build\classes\preverified" />
<!-- source folder -->
<arg value="build\classes\unverified" />
</exec>
I solved this problem by including the jdk\bin directory path in environment variable PATH.

Phonegap and Blackberry WebWorks: build\StandardInstall does not exist

My environment is Windows XP.
JDK and Apache ant are installed.
Phonegap version is 1.7.0
BlackBerry Webworks SDK for smartphone: version 2.3.1
I'm following the instruction of http://docs.phonegap.com/en/1.7.0/guide_getting-started_blackberry_index.md.html#Getting%20Started%20with%20Blackberry to try phonegap on blackberry.
The sample Blackberry WebWorks sample application I use is this https://github.com/phonegap/phonegap/tree/master/lib/blackberry/sample
First I execute 'ant blackberry build'. Although it said "BUILD SUCCESSFUL", however, neither StandardInstall nor .cod was created. And the output contained error message like this:
[exec] E:\Temp\widgetGen.15924526831337325595265.tmp\extension\blackberry\common\util\URLDecoder.java:183: unclosed string literal
[exec] decodingMap.put( "%AC", "? );
[exec] ^
[exec] 100 errors
[exec] Error!: Error: java compiler failed: C:\Program Files\Java\jdk1.6.0_32\bin\javac.exe #E:\TEMP\rapc_02802fef.dir\options
[exec] [ERROR] RAPC exception occurred
The full build log is here http://www.cis.nctu.edu.tw/~gis90571/a.txt
Then I execute 'ant blackberry load-simulator', it shows:
...
BUILD FAILED
D:\WebWorks_projects\helloworld\build.xml:33: The following error occurred while
executing this line:
D:\WebWorks_projects\helloworld\blackberry.xml:123: D:\WebWorks_projects\hellowo
rld\build\StandardInstall does not exist.
the content of blackberry.xml is:
123: <copy todir="${simulator.dir}">
124: <fileset dir="${build.dir}/StandardInstall" includes="*.cod, *.cso, *.csl, *.alx" />
125: </copy>
(I put the sample app provided by phonegap in D:\WebWorks_projects and changed its name to "helloworld".)
I'm new to ant and blackberry.
Could someone please offer some help or hint? Thanks.
Answer:
It seems that the source file URLDecoder.java in \ext\common\blackberry\common\util is broken due to some encoding issue. Fix it and the problem solved.
An useful article here: http://whatdrewknows.blogspot.com/2012/04/cordova-blackberry-development-part-2.html
Your application is not successfully getting built.
If your application gets build and generate 3 folders
OTAInstall
StandardInstall
widget
As well as one application.zip file is also created.
If you get all these files then your application was successfully compiled and built.

Ant build and empty directories

For some reason, when I use scp to move files from my current machine to the server using ant it always ignores empty directories.
<scp todir="ec2-user#xx.x.x.xxx:/var/www/html" keyfile="${basedir}\..\keys\prod_default.pem" trust="true">
<fileset dir="${staging.dir}" />
</scp>
Why is the case?
Full Update verbose log:
D:\BUILD\SCRIPTS>ant -v -f getcom.xml update
Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Buildfile: D:\BUILD\SCRIPTS\getcom.xml
Detected Java version: 1.7 in: C:\Program Files (x86)\Java\jdk1.7.0_02\jre
Detected OS: Windows Server 2008 R2
parsing buildfile D:\BUILD\SCRIPTS\getcom.xml with URI = file:/D:/BUILD/SCRIPTS/getcom.xml
Project base dir set to: D:\BUILD\SCRIPTS
parsing buildfile jar:file:/C:/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml
with URI = jar:file:/C:/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
[property] Loading D:\BUILD\SCRIPTS\build.properties
Build sequence for target(s) `update' is [update]
Complete build sequence is [update, upload, cleanup, staging, export, init, ]
update:
[exec] Current OS is Windows Server 2008 R2
[exec] Executing 'C:\\Program Files (x86)\\subversion\\bin\\\svn' with arguments:
[exec] 'update'
[exec] 'D:\BUILD\SCRIPTS\..\_STAGING\GETOM'
[exec] '--username'
[exec] 'uuuu'
[exec] '--password'
[exec] 'uuuu'
[exec]
[exec] The ' characters around the executable and arguments are
[exec] not part of the command.
[exec] Updating 'D:\BUILD\_STAGING\GETOM':
[exec] At revision 134.
[scp] Connecting to xx.0.0.100:22
[scp] done.
[scp] Connecting to xx.0.2.100:22
[scp] done.
BUILD SUCCESSFUL
Total time: 8 seconds
Properties:
svn.repoBaseURL="https://uuu#uuuu.uuuu.com"
svn.username="uuuu"
svn.password="uuuu"
svn.bin=C://Program Files (x86)//subversion//bin//
MSBuildPath=C://WINDOWS//Microsoft.NET//Framework//v4.0.30319//MSBuild.exe
lib.path.ant-contrib=C:/ant/lib/ant-contrib-1.0b3.jar
Please note, folder names have been changed.
You'll have to come up with a workaround. The way that Ant implements the scp means that empty directories are always skipped.
The gist of it is that the Scp class does this:
DirectoryScanner scanner = set.getDirectoryScanner(getProject());
Directory root = new Directory(scanner.getBasedir());
String[] files = scanner.getIncludedFiles();
if (files.length != 0) {
...
}
In other words, it only processes the directory if it contains at least one file.
There is a patch for the Scp task code you might consider, but that means a bespoke Ant build.
The two other approaches that come to mind are
make the directories non-empty by populating with placeholder files (which you can delete once deployed)
create the empty directories in a separate step

Resources