Passing parameters to an ant build building an eclipse plugin - plugins

I'm trying to build an eclipse plugin from console which works fine.
Now I want to add a parameter to the ant script. I looked it up and and read here that I can pass an arbitary parameter like this:
-D{paramName} {paramValue}
Also the official documentation says I can put it after the -application parameter. It states:
Note that the parameters appearing after the application are the parameters that are passed to Ant.
This is my build script which runs fine if I do not specify the additional custom -DeclipseLocation parameter.
java
-jar C:\Eclipse_3.7.2_WIN32\plugins\org.eclipse.equinox.launcher_1.2.0.v20110502.jar
-application org.eclipse.ant.core.antRunner -DeclipseLocation "D:\Program Files\Eclipse_3.7.2_WIN32" -buildfile D:\build.xml
When running I get the an error message that says
Unknown Argument: -DeclipseLocation
Unknown Target: "D:\Program Files\Eclipse_3.7.2_WIN32
No known target specified
So what am I doing wrong. How can I pass custom parameters to my ant build here?

The format is
-D{paramName}={paramValue}
You must have an '=' between the name and the value

Related

Gradle not able to install properly

I am trying to install the gradle 1.3 on window 7 machine and did the following steps
1.Downloaded the gradle-1.3.all.zip from http://www.gradle.org/ url
2.Extracted it to F:\localRepository\gradle-1.3
3.Set the environment variables
GRADLE_HOME=F:\localRepository\gradle-1.3
GRADLE_OPTS=F:\localRepository\gradle-1.3\bin
PATH = F:\localRepository\gradle-1.3\bin;F:\jdk1.7.0_21\bin
JAVA_HOME=F:\jdk1.7.0_21
JAVA_OPTS=F:\jdk1.7.0_21\bin
4.RUN gradle in CMD
5.getting
"Could not find or load main class F:\jdk1.7.0_21\bin"
Can anyone suggest me what I am missing here?
Those JAVA_OPTS look suspicious to me. What are you trying to achieve by setting them to that?
If you look at gradle.bat (in F:\localRepository\gradle-1.3\bin) you'll see this line which actually launches Java to run Gradle:
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.launcher.GradleMain %CMD_LINE_ARGS%
So as far as Java's concerned, your %JAVA_OPTS% looks like the name of the main class. Everything after that just gets parsed as parameters.
JAVA_OPTS is for the parameters you want to pass to the JVM.
Your GRADLE_OPTS also looks a bit unusual.
about the JAVA_OPTS and GRADLE_OPTS I'm citing from Gradle documentation:
JVM OPTIONS
JVM options for running Gradle can be set via environment variables. You can use GRADLE_OPTS >or JAVA_OPTS. Those variables can be used together. JAVA_OPTS is by convention an environment >variable shared by many Java applications. A typical use case would be to set the HTTP proxy >in JAVA_OPTS and the memory options in GRADLE_OPTS. Those variables can also be set at the >beginning of the gradle or gradlew script.
http://www.gradle.org/installation
But in general it's not suitable placeholder for bin folder. You better define your Path variable as:
Path=%JAVA_HOME%\bin;%GRADLE_HOME%\bin;
and remove or redefine your JAVA_OPTS or GRADLE_OPTS variables.

Eclipse run error

When i try to run my code on Eclipse this error appears:
Usage: javaw [-options] class [args...]
(to execute a class)
or javaw [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
-hotspot is a synonym for the "server" VM [deprecated]
The default VM is server.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose:[class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
i try to coment my entired code and this error still appear.
It seems you haven't set your java path correctly.
Setting Up Eclipse with Java 1.6 on Windows
How To Install and Get Started with Java Programming
Run eclipse in clean mode
Edit the eclipse.ini file located in your Eclipse install directory and insert -clean as the first line.
If this is happening to a specific project only and other projects are running fine then your default run configuration might have changed. You may try the following
- Run -> Run As -> 1 Java Application.
I fixed this issue by deleting some of my old runtime configurations. Eclipse then started automatically generating them again.

gwt-preprocessor - Unknown argument: -remoteUI

I'm trying to use the gwt-preprocessor for reflection with gwt. I created a run configuration for it in Eclipse. It seems to run the preprocessor fine, but after that I think it's trying to run the gwt compiler when I get "Unknown argument: -remoteUI".
If I remove the "remoteUI" argument from the run configuration, then I get the following error: Missing required argument 'module[s]'
If someone has a working configuration in Eclipse, can you specify the exact steps for installing gwt-preprocessor? Thanks!
If you are using dev mode please use org.hawk.gwt.ppc.DevModeWrapper instead of org.hawk.gwt.ppc.CompilerWrapper as main class. Here is my example how I'm creating debug configurations:
Create web application configuration (gwt web application).
On the main tab replace DevMode class with org.hawk.gwt.ppc.DevModeWrapper
Here is example of Arguments->Program arguments section:
-Puse-generics -Pprocess-annotations -Preflect=org.hawk.gwtppc.webtest.tests.** -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9997 -port 8888 -war /Users/alexbereznevatiy/dev/gwtppc/webtests/war org.hawk.gwtppc.webtest.webtest
The rest is pretty much the same. Make sure you are including proprocessor binary to the classpath tab as well as on sources tab.
Feel free to ask any questions or register bugs in gwt-preprocessor (if you find any).

Gallio with NCover shows 0% code coverage in Sonar UI

I am using sonar-runner to run tests and code coverage over my C# code with the help of gallio plugin. The tests are running fine, but I am not able to see any code coverage on the sonar web UI.
My Sonar settings are as follows:
sonar-project.properties
mentioning only relevant bits
sonar.gallio.coverage.tool = NCover
sonar.NCover.installDirectory = C:/Program Files/NCover
sonar.donet.visualstudio.testProjectPattern = .Test
sonar.dotnet.buildConfigurations = "Release|x86"
Any idea what coule be missing??
sonar.projectKey=XXX:XXX
sonar.projectVersion=trunk
sonar.projectName=XXX
sources=.
sonar.language=cs
sonar.dotnet.visualstudio.solution.file=Project.sln
sonar.dotnet.excludeGeneratedCode=false
sonar.dotnet.4.0.sdk.directory=C:/WIndows/Microsoft.NET/Framework/v4.0.30319
sonar.dotnet.version=4.0
# Gallio
sonar.gallio.mode=
sonar.gallio.coverage.tool=NCover
sonar.gallio.runner=IsolatedAppDomain
sonar.NCover.installDirectory=c:/Program Files/NCover
sonar.gallio.installDirectory=C:/Program Files/Gallio
sonar.dotnet.test.assemblies=$(SolutionDir)/../**/bin/**/*.Tests.Unit.dll
# FXCop
sonar.fxcop.mode=
#StyleCop
sonar.stylecop.mode=
#NDeps
sonar.ndeps.mode=skip
sonar-runner.properties
You said
sonar.dotnet.buildConfigurations = "Release|x86"
If that's true, your build likely isn't generating .pdb files, which are needed to figure out the mapping between the binaries and your source files.
Does it work if you try it with a Debug build?
I was seeing this same behavior with NCover in Sonar. I found that Sonar was generating invalid arguments for Gallio's NCover runner.
Try piping the output from Sonar's runner into a text file so that you can examine the arguments more easily (on the command line, you can just type sonar-runner > output.txt to do this).
You will likely see a line like this in your output:
INFO .u.c.CommandExecutor - Executing command: C:\Program Files\Gallio\bin\Gallio.Echo.exe /r:Local /report-directory:E:\Reports\.sonar /report-name-format:gallio-report /report-type:Xml E:\Projects\UnitTests\bin\Release\UnitTests.dll /runner-property:NCoverCoverageFile=E:\Reports\.sonar\coverage-report.xml /runner-property:NCoverArguments=//ias MyFirstAssembly;MySecondtAssembly;MyThirdAssembly
If you attempt to execute this manually via Gallio on the command line, you will get an error:
Cannot find file 'MyFirstAssembly;MySecondtAssembly;MyThirdAssembly'
If you edit this list manually down to a single entry such as MyFirstAssembly*, everything will work as expected.
This seems to indicate that Sonar is generating invalid command line arguments for Gallio. As much as I love NCover, the easiest solution was to use OpenCover instead.

sbt: Unable to specify application configuration in mingw

I am trying to launch an application using sbt's application launcher.
This application is defined as:
#!/bin/sh
java -jar /home/salil.wadnerkar/.conscript/sbt-launch.jar #"/home/salil.wadnerkar/.conscript/n8han/conscript/cs/launchconfig" "$#"
However, when I launch it, it gives me this error:
$ ~/bin/cs n8han/giter8
Error during sbt execution: Could not find configuration file 'C:/MinGW/msys/1.0/home/salil.wadnerkar/.conscript/n8han/conscript/cs/launchconfig'. Searched:
file:/C:/MinGW/msys/1.0/home/salil.wadnerkar/
file:/C:/Users/salil.wadnerkar/
file:/C:/MinGW/msys/1.0/home/salil.wadnerkar/.conscript/
However, the file is present there. So, I think it's because of some quirk in the way sbt handles mingw file path.
Does anybody know how I can get it working?
In Cygwin I used
java -jar "`cygpath -m "$HOME/.conscript/sbt-launch.jar"`" "#file:///C:/Users/cvanvranken/.conscript/n8han/conscript/cs/launchconfig" "$#"
I expect you will be able to get yours to work with something similar, perhaps this:
java -jar /home/salil.wadnerkar/.conscript/sbt-launch.jar "#file:///C:/Users/salil.wadnerkar/.conscript/n8han/conscript/cs/launchconfig" "$#"
or
java -jar /home/salil.wadnerkar/.conscript/sbt-launch.jar "#file:///C:/MinGW/msys/1.0/home/salil.wadnerkar/.conscript/n8han/conscript/cs/launchconfig" "$#"
if those fail, you still definitely need to use the file:// protocol.
Also note the three directories it is searching in the error message
file:/C:/MinGW/msys/1.0/home/salil.wadnerkar/
file:/C:/Users/salil.wadnerkar/
file:/C:/MinGW/msys/1.0/home/salil.wadnerkar/.conscript/
no matter what you put in the launchconfig parameter, if it is not recognized then those directories are searched by default. So you could have gibberish in your parameter and still see the same exact error you are getting now.
you can set the launch config path relative to the .conscript folder -
java -jar /home/salil.wadnerkar/.conscript/sbt-launch.jar #n8han/conscript/cs/launchconfig "$#"