Need to create a folder in remote server usint ant - ant

using ant scp i can able to copy a file from local system(windows) to server(linux).so what i need is i want to create a folder by the system date at specified directory in linux system using ant and copy the file to the folder which created..
this is my ant script:
<sshexec host="hostname:22" username="****" trust="true"
password="fcubs"
command="mkdir $/home/desktop/<folder to be creted here>"/>
<scp todir="username#hostname:/home/desktop" password="*****" trust="true">
<fileset dir="D:\kkk"/>
</scp>
pls help me
thanks in advance

you can use such linux command which creates directory:
export ATD=`date '+%h-%d-%Y_%H:%M:%S'` && cd /path/to/specified/dir && mkdir $ATD && cd $ATD
it will create dir (for example) "Nov-14-2012_17:41:02" in the dir /path/to/specified/dir and will cd to it.
after executing this command you can simply copy your file to the directory.

Related

Rename .zip file generated by electron packager

Electron-packager generates folder my-app-win32-x64 but I want this file to be only my-app. I want rest to be removed. I understand electron packager generates .zip file. When this is unzipped it retains the same name.
I tried editing index.js under electron-packager. I am not able to understand this .zip file is generated. So that I can edit the name in which elctron-packager generates this file.
Directory structure:
my-app
/scripts
...
...
/win64
/my-app-win32-x64 //this directory name must be just my-app
my-app.exe
/app
Build script:
"build": "electron-packager --out winx64 --overwrite --platform win32 --appname my-app . --icon=./my_logo.ico --executable-name my-app"
I don't understand how this relates to any ZIP file at all. electron-packager creates a directory structure with an executable, folders, etc., but no ZIP file.
Electron-packager creates a directory {out}/{appname}-win32-x64 where {out} and {appname} are the given command line parameters.
Since you want this output directory to have a different name, you could simply rename it after it's created.
Linux/Mac:
"build": "electron-packager ... && mv win64/my-app-win32-x64 win64/my-app"
Windows:
"build": "electron-packager ... && ren win64\my-app-win32-x64 win64\my-app"
The && runs the second command only if the first one completes successfully (non-zero exit code).

SVN: Add a set of Subdirectories but only specific files

I have a subfolder with a lot of subfolders in it. Each subfolder has an settings.ini file in it. Every once in a while a new subfodler with a Ini-File and a lot of other files and subirectories are added, i want to automatically add and commit it via jenkins, but only the folder and the ini.
C:/Program Files (x86)
-horst
--kevin
---settings.ini
--georg
---settings.ini
--heinz
---settings.ini
--herbert
---settings.ini
...
I tried:
svn.exe --quiet --password %SVNPW% --username "%SVNUSER%" add --depth infinity --parents "C:/Program Files (x86)/horst/*/settings.ini"
But this is not working, I get the message:
svn: E720123: Can't make directory 'C:/Program Files (x86)/horst/*'
Is there another solution, what am I doing wrong
regard Nils
This does the trick
cd "C:/Program Files (x86)/horst"
dir /B /S settings.ini > file_list.txt
%SVN% --quiet --password %SVNPW% --username "%SVNUSER%" add --depth infinity --parents --targets file_list.txt
I created a list of targets I want to add and let SVN crawl it.
Nils

Working bin/bas returns error when executed from run script Xcode

I have a working shell script that works with no problems but when I executed it with a run script i get the following error:
The script will scan all the proto files in a directory and convert it to Swift using ProtoBuf. After that I will move the swift files into an App folder. The script code is the following
#!/bin/bash
for protoFile in ./*.proto;
do
protoc --swift_out=. $protoFile
done
for file in ./*.swift;
do
mv $file ../Convert\ AV/Model/USBDongle/Proto/
done
Any ideas?
Thank you
I was calling the script from the directory it was located. When Xcode executes the the script that assumption is false. So I am getting the directory where the script is located and I do the logic with that path
#!/bin/bash
#Get Directory where the script is located
baseDirectory=$(dirname "$0")
echo "$baseDirectory"
for protoFile in "$baseDirectory"/*.proto
do
echo $protoFile
protoc --swift_out="$baseDirectory" -I "$baseDirectory" "$protoFile"
done
for protoFileSwift in "$baseDirectory"/*.swift;
do
echo $protoFile
mv "$protoFileSwift" "$baseDirectory"/../Convert\ AV/Model/USBDongle/Proto
done
* /* Makes like is a comment... *

Unit not found: 'System.pas' or binary equivalents (.dcu) : Compiling on jenkins

I'm using Jenkins to generate automatic build every 15 minutes for a test project.
When compiling for Delphi itself does not give a problem, now when I run by jenkins it gives the following problem ...
C:\Program Files (x86)\Embarcadero\RAD
Studio\7.0\Bin\CodeGear.Delphi.Targets(136,3): error : Project1.dpr(1)
Fatal: F1027 Unit not found: 'System.pas' or binary equivalents (.dcu)
I have already tried to run by windows command this way.
cd "C:\Users\carlos.santos\Desktop\teste"
call build.bat
And Build.bat in this way.
call "C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\bin\rsvars.bat"
msbuild "Project1.dproj" /p:config=Release /p:Warn=0
I have already tried to run by the Rad Studio plugin itself for Jenkins this way and it also did not work.
I have already seen in some forums that if I have many paths or do not have the default paths of Delphi in Library path can be a problem, but I have tested this too and nothing ..
Here are the paths I have.
$ (BDS) \ lib; $ (BDS) \ Imports; $ (BDS) \ Lib \ Indy10; $
(BDSCOMMONDIR) \ Dcp; $ (BDS) \ include; $ (BDS) \ RaveReports \ Lib;
$ (BDSCOMMONDIR) \ Bpl; $(BDS)\lib\debug; $(BDS)\bin; $(DELPHI)\Bin;
The Content of rsvars.bat are there:
#SET BDS=C:\Program Files (x86)\Embarcadero\RAD Studio\7.0
#SET BDSCOMMONDIR=C:\Users\Public\Documents\RAD Studio\7.0
#SET FrameworkDir=C:\Windows\Microsoft.NET\Framework\v2.0.50727
#SET FrameworkVersion=v2.0.50727
#SET FrameworkSDKDir=
#SET PATH=%FrameworkDir%;%FrameworkSDKDir%;%PATH%
#SET LANGDIR=EN
I have third party component installed in my Delphi, but I do not know if it influences anything. Anyone who can help me will be grateful.
the difference between the properties executed by jenkins and cmd are these:
it was resolved putting the paramether _EnvLibraryPath with my Delphi
LibraryPath parameter on msbuild call, example:
call "C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\bin\rsvars.bat"
msbuild "C:\Users\carlos.santos\Desktop\teste\Project1.dproj" /p:_EnvLibraryPath="C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\lib\EN;C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\lib"
There may be another cause for that same problem.
I have just experienced it and solved it.
In my case, it was related to the fact that I had another configuration besides Release and Debug, i.e. ReleaseConsumer.
My build command included specifying the configuration:
DoJenkinsTasks "US2D_GUI" "Config=ReleaseConsumer;Platform=Win64"
Now, I got that same error as mentioned above.
The cause is that it can't find the ReleaseConsumer folder with dcu files.
I solved it by creating, under c:\Program Files (x86)\Embarcadero\Studio\19.0\lib\win64\, a new folder releaseConsumer and copying all dcu files from release to it.
Run msbuild with the /v:diagnostic option, and you will see that none of the default environment paths are set:
Initial Properties:
___ResourcePath =
__ObjectPath =
__ResourcePath =
_EnvDCPOutput =
_EnvLibraryPath =
_EnvNamespace =
_EnvPackageOutput =
_ObjectPath =
_OutputDRCFiles = false
_ProjectFiles = #(DelphiCompile)
_ResolveGENTLBBindingsTarget =
This is because you are missing the %APPDATA%\CodeGear directory on your build server (under the user that is running the builds).
Particularly, you need the CodeGear\BDS\7.0\EnvOptions.proj settings file, which contains all the environment variables.
Put that in place and you'll see msbuild's diagnostics shows properties like this one:
Initial Properties:
___ResourcePath = C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\lib;\Imports;C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\Imports;C:\Users\Public\Documents\RAD Studio\7.0\Dcp;C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\include;C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\lib;C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\Lib\Indy10;

Compiling java programs from CLI using javac

I have the following directory structure form where I am invoking javac
src/ lib/ build/
Under src:
src/com/xyz/App.java -- contains the main class
src/com/xyz/base/j1.java
src/com/xyz/base/j2.java
src/com/xyz/exceptions/e1.java
src/com/xyz/hibernate/factory/hbf1.java
src/com/xyz/hibernate/helper/hbh1.java
Under lib:
lib/hibernate.jar
lib/commons.jar
At the top level, I am using the following javac command:
javac -verbose -classpath lib/hibernate.jar:lib/commons.jar -d ./build -sourcepath ./src com/xyz/*.java
and I receive the following output
javac: No match
How should the args be passed to javac?
And here is the ANSWER:
javac -verbose -d build -classpath lib/commons.jar:lib/hibernate.jar [complete path for ALL the directories]/*.java
javac won't expand wildcards, that's what your shell does. so when you specify com/xyz/*.java , that will not expand to anything, as those files are under src/ but the shell doesn't know that. If you list out every java file as com/xyz/Foo.java com/xyz/Bar.java etc, it should work.
(note that if you're on windows you'll need ; and not : to seperate classpaths)
Something like this might work:
javac -verbose -classpath build:lib/hibernate.jar:lib/commons.jar -d ./build ./src/com/xyz/base/*java ./src/com/xyz/exceptions/*.java ./src/com/xyz/hibernate/factory/*.java ./src/com/xyz/*.java
I'd not do this other than as an exercise on how to compile from a command line, otherwise use a build tool like ant

Resources