How do I set the output directory for a Build in Eclipse ?

I changed the directory structure above my project.

I can build the project, but the output files still go to old directory structure and the Settings Editor comes up with no settings for this project.

Where can I set the output for the project build so that it matches the new directory structure ?

Thanks

  • In my experience, the output from the standard project build should go to .\bin under the project root, regardless of what you select for "build for device" or "export wizard".

    If you right click on your project folder in eclipse and select Show In > System Explorer, does the correct folder open in Explorer?

    If you open .project in another text editor, is there anything unusual in the contents?

    The settings metadata (generated by the build) should also be in .\bin with a file named like <projectname>-settings.json.

    Not directly related to your problem, but when you send settings to the simulator and run apps, the actual .PRG (program binary) and .SET (settings file) go to the simulator's working folder: %TEMP%\GARMIN, The layout of this folder is just like the layout of a real device's folder -- apps go under APPS\ and app settings go under APPS\SETTINGS.

    When you build or run your project, what does the console output look like? I assume the -o command line parameter is pointing to the old project directory?

    Mine looks like this:

    (My project root is C:\Users\...\workspace\testdatafield)

    BUILD: C:\Program Files\Java\jre1.8.0_131\bin\java -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar C:\Users\...\AppData\Roaming\Garmin\ConnectIQ\Sdks\connectiq-sdk-win-3.2.5-2021-02-12-6d31f4357\bin\monkeybrains.jar -o C:\Users\...\workspace\testdatafield\bin\testdatafield.prg -w -y C:\Users\...\Documents\garmin\developer_key -f C:\Users\...\workspace\testdatafield\monkey.jungle

  • Thanks for the help.

    The -o command line parameter does point to the old directory.

    Do you know where / how I can change that to match the project's current location ?

  • Which folder opens when you right click on project in eciipse and select Show In > System Explorer?

    Can you post the contents the .project file in the project root? (You may have to use another editor to open this)

  • Show In > System Explorer shows the project in the new / correct directory, not the old directory where output is still going.

    Here are the contents of the .project file:

    <?xml version="1.0" encoding="UTF-8"?>
    <projectDescription>
    <name>xxNamexx</name>           the actual project name is here. Not ready to make this public
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
    <buildCommand>
    <name>connectiq.builder</name>
    <arguments>
    </arguments>
    </buildCommand>
    </buildSpec>
    <natures>
    <nature>connectiq.projectNature</nature>
    </natures>
    <filteredResources>
    <filter>
    <id>1630774514127</id>
    <name></name>
    <type>30</type>
    <matcher>
    <id>org.eclipse.ui.ide.multiFilter</id>
    <arguments>1.0-name-matches-false-false-**/.svn/</arguments>
    </matcher>
    </filter>
    </filteredResources>
    </projectDescription>

  • Thanks. Don't see anything unusual there.

    Does the original folder still have a ".project" file? What happens if you move/rename the old folder, and try to build again?

    (I assume that it will just recreate the old folder and create bin\ under that folder, but I'm curious.)

    Have you tried opening the project in a different workspace?

  • The original folder does still have a .project file and the contents looks the same as what I posted.

    I renamed the original folder and rebuilt. The old directory down to the /bin folder was reproduced.

    I just started trying to create and build with a new workspace. That is going to take a while.

    Interestingly the command line shows the old directory in the -o parameter and shows the new directory -f command line parameter.

    It sounds like where the directory specified in -o is coming from a mystery.

  • I renamed the original folder and rebuilt. The old directory down to the /bin folder was reproduced.

    That's pretty odd. You mean that all the current project source files and folders are copied over to the old directory? Or just OLD_DIR\bin is created?

    It sounds like where the directory specified in -o is coming from a mystery.

    I'm not sure what's happening in your case, but I can do the following:

    1) Create project ("testdatafield")

    2) Build it

    3) Copy the whole project to another subfolder (without changing the project name or folder name)

    4) Remove the original project from Eclipse

    5) Add the new project to Eclipse

    6) Build the new project

    Everything works as expected. If I delete bin\ from the old project dir, it doesn't get recreated, so I know nothing's being built there. If I delete bin\ from the new project dir, it does get recreated, so I'm sure it's being built in the correct folder.

    Can you create a new project from scratch and copy/move over the source files and folders?

  • If my attempt with creating a new workspace and importing the project doesn't work I'll give that a try.

    Thanks

  • Sure np. I feel like if you just copy over source files (and not any metadata like .project), you should have a better chance of avoiding this weirdness.

  • That makes sense. I'll let you know how my experiments come out.

    Thanks again.