Eclipse Path Variable to Output folder - eclipse

I need to start an external tool in eclipse, which starts with some arguments. One of them revers to the output file. My problem is, that I have more than one build configuration, so I have multiple output folders, but I want to use just one external tool config.
External tool config
Is there A way, where I can set the output folder as a dynamic variable, which depends on the selected build config.

There exists a variable config_name:
https://www.eclipse.org/forums/index.php/t/1076833/
${config_name} of the current project is given by:
${config_name:${ProjName}}

Related

Deploying config files to PLC

Is it possible include arbitrary files (in this case a .csv) from a TwinCAT project direct to the Boot directory of a PLC?
By using PATH_BOOTPATH in the file open/read FBs it is possible to load files from this directory in a convenient manner regardless of whether using a CE or Windows deployment, However deployment of files to this location seems to be the sticking point.
I know that a copy of the project code is included within the CurrentConfig<Project>.tpzip file, but this file is not easily accessible from code, or updateable.
I've found the 'Additional Files' section within the system configuration, but it makes little sense.
Adding a file from inside the project as a 'Relative' path doesn't seem to do anything
Adding a file from inside the project as an external path includes the file (via symbolic links?) in the 'CurrentConfig.tszip' file, which has the same issues as the .tpzip
Adding an external file as an external path again includes the file inside of the .tszip.
I'm willing to accept that this might not be possible, but it just feels odd that the PATH_BOOTPRJ and PATH_BOOTPATH roots are there and not accessing useful paths.
Deployment
To quote Beckhoff:
Deployment is used to set up commands that are to be executed during the installation and startup of an application.
The event types are essentially at what stage of the deployment process the command is performed, where the command can either be copying a file or execution of a script/program.
Haven't performed extensive testing but between absolute/relative pathing and execution this should solve nearly all issues with deployment configuration.

How do I run a project in eclipse with different jboss-ejb-client.properties

I have EJBs deployed on several different servers, for different environments. I have many projects that use these EJBs. I usually just run my projects against the DEV server EJBs, but sometimes I need to run against the TEST or PROD environment EJBs. This necessitates having to comment out all of the DEV nodes in my jboss-client-ejb.properties file and uncomment all of the TEST nodes. But then if I forget to change them back, I may mess up some data if I run it later. What I would like to do is create a different runtime configuration for each environment, and have each runtime config use a different version of the jboss-client-ejb.properties. Is there a way to do this? If so how? I have looked at all of properties of a run configuration, and don't see anything helpful.
In eclipse preferences search for string variable substitution. Here create variables that point to multiple config files for each of your environments. Then create multiple run configurations and for each one (like dev or prod) add a program argument that points to your string variable defined in your preferences like this -DmyconfigFile={$MyDevPropertiesFilePath}, or you could hard code the config path and have multiple runtime configurations that use different config files. Key point here is create multiple runtime launch configurations for each environment and add the properties for each environment that point to the config file respective to each environment. This way you can easily select the launch menu and decide to run "dev" "prod" or whatever you name your multiple configurations. Trying to do this with one runtime configuration will cause pain as you say, because it is easy to forget to revert or change the config file you want to to use. Hope that helps. Also if you create a new workspace you can export your runtime configurations using the export wizard which is also helpful for passing on to other developers or putting in source control.
P.S Looking more at your question you wan to pass in the config file path as a program argument, you are correct there are no specific options for setting this file path. Using program arguments with multiple launch configurations.

how do i change values in .properties file and run a build using this in jenkins

i have a basic job that runs a .bat file to do an export of an application from a file server somewhere. it uses a .properties file in standard format to get the login details, server location and application name/version etc
i've made it work from command line and hard coding the values in the .properties file and running it. the export works and saves in the directory i specify.
i moved over to jenkins and it also works using the hardcoded .properties file.
what i want to do now is set the values in the .properties file inside jenkins so it can be updated without having to manually open the .properties file and then run the same .bat file
if someone could provide an example of setting just one value in a .properties file through jenkins, i feel i can do the rest.
You can try to use the EnvInject Plugin for Jenkins which allows to inject environment variables into build process, and modify your .bat file to use them instead of reading values from the properties file.
Here are some of the plugin's usecases/features:
To remove inherited environment variables (PATH, ANT_HOME, ...) at node level (master/slave), available by default for a job run.
To inject variables in the first step of the job (before the SCM checkout)
To inject variables based on user parameter values
To execute an initialization script before a SCM checkout.
To execute an initialization script after a SCM checkout
To inject variables as a build step obtained from a file filled in by a previous build step
To know environment variables used for a build
To inject build cause as environment variable for a build
To inject environment variables from the evaluation of a Groovy script (powered by Script Security Plugin)
To export environment variables as a metadata in your binary repository

Is there an environment variable or way to get custom task directory in VSO Build?

So I'm trying to get the custom build task directory name from powershell when executing a custom build task.
The purpose is that I want jshint to run on build time, and I've got it doing so, but the .jshintignore file needs to know a relative path to exclude files or folders.
So I need be able to get that path at runtime in order to know how many "../" to add on to the excluded files for the minmatch engine, which is what jshint uses, to match them.
I can, of course, hard code it, but that's really not what I'd prefer to do.
Yes, you can use the Agent.HomeDirectory variable.
Agent.HomeDirectory | AGENT_HOMEDIRECTORY | The directory the agent is
installed into. This contains the agent bits
The tasks folder will be $(Agent.HomeDirectory)\tasks(TaskFolder)\

Run node-webkit project in Netbeans 7.4

I am trying to configure Netbeans IDE 7.4 for node-webkit development.
It is excellent IDE but I want to run my projects with F6 button. To do this I added NW.EXE as additional browser (executable is located outside project folder).
After this I have a problem with execution arguments. NW.EXE expects a folder path to be specified as an argument, but I cannot leave empty field of Start File in project settings and the Project URL has to start with either http:// or file:// while Node-webkit needs a path like C:/path_to_app
Does any method exist to deal with this feature?
In short, you can work this around by creating a batch program and let it strip the file name down to the path name part, to be fed to nw.exe, as it requires.
Unfortunately, as you said, we don't have full control over the way the main file of the project is passed to the browser, hence some further actions (in addition to the creation of the batch file) are needed.
This is how I got it working after a bit of struggle:
added nw.exe to the system %PATH% variable (optional, just for ease of access)
created nw.bat in the same folder as nw.exe, and filled it with this content:
#echo %1
start nw.exe %~d1%~p1
The first line of this batch file is just to inspect the actual parameter that is getting passed to the batch file.
The second line uses start to invoke nw.exe without having to wait for its return (you may need to specify the full path to nw.exe, if you didn't add it to the system %PATH% variable).
The second line also passes to nw.exe the drive part of the parameter (extracted from %1 by %~d1) concatenating it to the path of the parameter (extracted from %1 by %~p1).
For instance, my last run from within NetBeans gave this output:
D:\node\test\index.html
D:\node\test>start nw.exe D:\node\test\
Then I needed something to tie the NetBeans run button to an arbitrary executable, and luckily I found a perfect fit.
So here is how I went on:
installed the Node.js Projects plugin from Timboudreau Update Center
went to Options > Miscellaneous > Node.js and set the Node.js Binary field to point to my nw.bat file
In my project, I've also taken care to put package.json in the same folder of index.html (being that that's the main file of my package, and that's what will be fed to the batch file).
Now pressing F6 on my NetBeans installation happily runs my node-webkit project without any further ado :-)