Can't use environment variables to specify VS solution path

Tommy's Avatar

Tommy

19 Dec, 2014 08:05 PM

I have the following configuration:

before_build:
[…] - mkdir %APPVEYOR_BUILD_FOLDER%-build - cd %APPVEYOR_BUILD_FOLDER%-build - cmake -DUSE_HEIMDALL=1 -G "Visual Studio 12" %APPVEYOR_BUILD_FOLDER% build:
project: C:\projects\rainbow-build\Rainbow.sln # Can't use %APPVEYOR_BUILD_FOLDER% ? […]

I tried to use '%APPVEYOR_BUILD_FOLDER%-build\Rainbow.sln' but it failed. So I had to hardcode the path. Is this a known issue?

  1. 1 Posted by Tommy on 19 Dec, 2014 08:08 PM

    Tommy's Avatar

    Sorry, I failed to format the YAML:

    before_build:
      […]
      - mkdir %APPVEYOR_BUILD_FOLDER%-build
      - cd %APPVEYOR_BUILD_FOLDER%-build
      - cmake -DUSE_HEIMDALL=1 -G "Visual Studio 12" %APPVEYOR_BUILD_FOLDER%
    build:
      project: C:\projects\rainbow-build\Rainbow.sln # Can't use %APPVEYOR_BUILD_FOLDER% ?
      […]
    
  2. Support Staff 2 Posted by Feodor Fitsner on 19 Dec, 2014 08:11 PM

    Feodor Fitsner's Avatar

    Variables in project are not supported. Just specify relative path to repo root:

    build:
      project: Rainbow.sln
    
  3. 3 Posted by Tommy on 19 Dec, 2014 08:20 PM

    Tommy's Avatar

    I also tried that. Didn't work. I can try again though.

  4. Support Staff 4 Posted by Feodor Fitsner on 19 Dec, 2014 08:22 PM

    Feodor Fitsner's Avatar

    I see. You are changing current folder before build.

    Try switching back cd.. as a last command in before_build.

  5. 5 Posted by Tommy on 19 Dec, 2014 08:28 PM

    Tommy's Avatar

    I don't understand. What I tried to do here is to make a directory parallel to the build dir:

    Clone: C:\projects\rainbow
    Build: C:\projects\rainbow-build

    I ran cmake in the -build folder so the .sln file is in there.

  6. Support Staff 6 Posted by Feodor Fitsner on 19 Dec, 2014 08:31 PM

    Feodor Fitsner's Avatar

    Automatic build is bound to a clone folder. It's still looking for that .sln in C:\projects\rainbow.

    Why don't just provide your own "msbuild" command?

  7. 7 Posted by Tommy on 19 Dec, 2014 08:34 PM

    Tommy's Avatar

    Ah, thanks. I'll do that instead.

  8. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:53 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac