Skip to content
This repository has been archived by the owner on Oct 31, 2021. It is now read-only.

User Defined Compile Time constants #25

Open
dbwz8 opened this issue Dec 31, 2015 · 1 comment
Open

User Defined Compile Time constants #25

dbwz8 opened this issue Dec 31, 2015 · 1 comment

Comments

@dbwz8
Copy link

dbwz8 commented Dec 31, 2015

Ok, I decided to just sprout this as a new issue (since everything I've tried doesn't work, and we're completely blocked at this point).

AFAICT, the .xproj file should support: in the Globals PropertyGroup. It's ignored.

However, the Project.json file appears to be the right place and should support define (according to online docs):

  "compilationOptions": {
     "optimize": true,
     "emitEntryPoint": true,
     "define": ["TRUE","PORTABLE"]
  },

It's ignored.

The other approach is to put it in a configuration:

  "configurations": {
    "Debug": {
      "compilationOptions": {
        "define": ["DEBUG", "TRACE", "TRUE","PORTABLE"]
      }
    },
    "Release": {
      "compilationOptions": {
        "define": ["RELEASE", "TRACE", "TRUE","PORTABLE"],
        "optimize": true
      }
    }
  },

but that's also ignore.is also ignored.

Is this expected at this time, or am I doing something wrong?

For sanity checking, I added some compile time warnings to the code and then turned on warningsAsErrors in both of the last two examples... made no difference, so my guess is that these sections are being completely ignored at this point.

@Alxandr
Copy link
Contributor

Alxandr commented Jan 6, 2016

You're right. It should be in project.json, and it's ignored. Also, as far as I know, DNX is going away, so I'm not sure there is any point in continuing adding features to this. The "new way" is dotnet CLI. Someone else has (as far as I know) already made F# support for that (it's a lot simpler). Whether or not it support custom constants though, I have no clue.

Leaving the issue open for now though, until I know for sure that DNX is really dead (dying).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants