*.bat Files opened from Eclipse is opened in the wrong directory -


I'm completely new to scripting, but I'm sick of compiling my original code for Android manually And tired so that I wrote a little bit in cybbin to run this script. Both the .sh script and a .bat file are placed in the root of a project, the NDK directory is set in the .sh file and then the .bat file By running I compile my original code Am.

The problem is that I want to do this because it is dynamic so I use% cd% to get the current directory (which should be a project folder) and start the .sh file in that directory I do

Here are both files:

.bat:

  @echo off: To keep an alert about the DOS directory format Used CYGWIN = Set the nodosfilewarning C: \ cygwin \ bin \ bash --login -i% cd% ./comile.sh pause  

.sh:

  #! / Bin / bash # Run this script through compileNative.bat. This will compile the original code of the project #IIF, this file will be changed under Windows "tr -d" \ r ' Sh "# Project Root to remove the bad line end Place both this and .bat file in. Set the # base NDKDir NDKDIR = C: / Android / NDK / # to the base directory so that we can change the directory to the base. BASEDIR = `dirname $ 0` compiling the resonance resonance original code, then refresh workspace! Replace # Change the directory of the project, the change is that if the project films. CD $ BASEDIR # Run NDC Build File Change it to the right place. $ NDKDIR / Ndk-build  

When I open the .bat file from the folder in windows then it runs just fine. When I run it from eclipse, though it seems that% CD% gives me "C: / Eclipse" is disturbing me more than it is true that it all ran away in the morning, but suddenly he started doing this .

So my question is, am I incorrectly using% cd% or why this could happen. Obviously this is not a big drama but it is a small problem which I can not understand.

Some help would be great.

I recommend creating an external device configuration for this (a green run icon with a red box - or located next to the run / debug icon). External tools can launch scripts with predefined environment variables or work directories.

To set these directories dynamically (depending on the currently selected project), you can use the platform variable, such as $ {container_loc} or $ {resource_loc} - Use the Variable ... button to get the list of available variables.

Update : This way you can add directly to the Sigwin script without the need for the bat file.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -