javac fork mode - javac

I am working on a project and saw the following configuration with a comment in a properties file.
# Forking just invokes the JVM externally, and doesn't exhibit any performance benefit.
javac.fork.mode=no
I am curious about what this means.
After several google searches, I still can't find a specific article about this. Could someone point me to a good resource?

An option from the ant's <javac> task.
When fork=true ant will run the java-Compiler in it's own jvm.
http://ant.apache.org/manual/Tasks/javac.html

Forking allows javac to run as external process in its own heap space thus limits the memory leak to external process without affecting the parent java process.
Check the thread below which tells other options to be used along with 'fork' if you are using 'javac' Ant task.
How to tell ant to build using a specific javac executable?

Related

Is there a platform-independent way to run Perl/Python/Ruby scripts in Jenkins?

See title. Currently, I do either run the scripts on Windows with a CMD or by using a shell on Linux. This seems a bit unflexible to me since it limits the jobs to be run either on Windows or on Linux.
How would I define a job which simply does run my test scripts written in Perl/Python/Ruby/WhateverOtherScriptingLanguage regardless on which OS the Jenkins instance is running.
The correct script interpreter can be assumed as installed, of course.
The cross-platform shell plugin solves exactly this problem -- however, the last release was done in 2014, and there's a couple of open issues that might prevent you from using it in a production environment.
As an alternative, there is plugins for wrapping the actual call to the interpreter into plugin code. With a plugin, you become independent from OS-specific shells. However, the plugin will be language-specific, e.g.,
For Python, the ShiningPanda plugin is popular
For Ruby, the Ruby plugin will do that (albeit only for embedded scripts)
For Perl, there is no such thing
In any case, you'd depend on availability and maintenance of an additional plugin. Plus, adding fat plugins to Jenkins just to wrap a system call is somewhat awkward.
I reckon that the most versatile and compact solution is to introduce a Groovy build step, and to start the interpreter with a one-liner from there, e.g.:
"perl myscript.pl".execute();
This will work on any platform, as long as you ensure that Groovy is available, e.g. by using the Groovy plugin.
If you prefer Python, you can probably do the same with short wrapper that you start via the ShiningPanda plugin.
Shell scripts in Jenkins provide crossplatform she-bang.
#!perl
print "hi"
will work both on linux and windows, perl should be in PATH.
UPD. Actually we had shell installed on windows hosts so it might be not working without it.

Delete read only files with Ant on windows

I have an Ant script performing some updating etc and one task is to delete a few files and folders.
In Windows and especially version 7 there seem to be some kind of Read Only Attribute mayhem and I have tried several solutions with no success.
There are several other SO issues similar to this but no solution really.
Ant is not able to delete some files on windows
Is there any way to make Ant ignore the Read Only Attribute?
The ant chmod task seems only to work for Linux; searching for "ant chmod windows" yielded i.a. Attr. Then you could first make all writable. Maybe with ant delete failonerror=false.
Okay, that does not work too. Maybe use PsExec, a tool to run things as Administrator. Unlikely that a solution in the form of an ant task may be found.

How do you integrate ivy with MSbuild

What approach has worked well for you combining IVY + msbuild?
Our goal is to integrate IVY into the C#/C++ build process for dependency resolution and publishing. We have tried adding it to custom tasks at the beginning and end of the build and we have tried wrapping the msbuild calls with ant+ apache-ant-dotnet.
Other options might be gradle, buildr, rake.
What do you use?
Thanks
Peter
Most build technologies can use libraries found in a local directory. I'd suggest using the command-line ivy program to populate this, at the start of your build:
java -jar ivy.jar -ivy ivy.xml -settings ivysettings.xml -retrieve "lib/[conf]/[artifact].[ext]"
Your dependencies are listed in a standard ivy file called ivy.xml. The protocol, location and layout of your remote repository is described in ivysettings.xml
The advantage of this approach (as opposed to switching to Gradle, etc) is that you're not trying to replace your existing build tool. Ivy is solely concerned with managing dependencies.
My team has been using Ivy for .NET for a couple of years very successfully. I know several more that give it a vote of confidence.
Use it standalone. Wrap calls into msbuild tasks. No need to use Ant integration.

Ant gc task for mxmlc?

In my project I use Ant as a build script. During compile phase I have to compile about 20 modules and the number is growing. To compile my modules I sequentially call mxmlc task. Everything works as expected except that it seems that mxmlc doesn't release memory.
I already set:
export ANT_OPTS="-Xms1536m -Xmx1536m -XX:PermSize=1024m -XX:MaxPermSize=2048m"
But my build script already reaches the limit. So, I am curious if there is any way to release unused memory? Or maybe there is another handly way to avoid memory leaks?
As an idea I consider to create additional build script that takes some args and does build only of one module and call this flex build script from my main build script as a external app. But it is a hack. Would be great to know some more professional way to handle it...
Thank you all in advance!
I had this problem and solved it by having the ANT task for mxmlc fork:
<mxmlc fork="true" ... >
This causes mxmlc to spawn another process for the compiling (of each application/module).
As a temporal solution I have implemented my "idea" described above. Works actually fine. Hope it will be usefull for somebody.

Running Delphi builds under TFS MSBuild

Wanting to build and test a bunch of Borland Delphi 6 projects that are integrated with ASP.NET services. Had been using WANT and CruiseControl for building Delphi. With TFS Build agent we can tie all together and do some testing. I am looking for guidance and direction.
One issue I see is that there is no "solution" in a Delphi project to be given to MSBuild as a '<'SolutionToBuild'>'.
<SolutionToBuild Include="There is no such thing as a Delphi.sln">
<Targets></Targets>
<Properties></Properties>
</SolutionToBuild>
Also, I have references to <UsingTask> but am a little unsure how to use them. The <UsingTask> allows run custom task for Delphi command-line compile.
Your guidance would be appreciated.
Can you upgrade? Delphi 2006+ uses MSBuild by default. There is nothing to configure.
You can use MSBuild to run the Delphi command line compiler. It's been a while, but I'm pretty sure either the IDE supports command line compilation or there is a stand-alone compiler that can be run from the command line. In either case, you would need to create an <Exec> task that runs the appropriate command line build tool with the required parameters.
When you say you have "references to <UsingTask>" do you mean that you are importing an external MSBuild task? The <UsingTask> element is used to pull in a custom MSBuild task that resides in an external assembly (DLL). Once the task is imported, you use it just like you would any other built-in task.

Resources