New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to project.json schema #175

Open
ajaybhargavb opened this Issue May 2, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@ajaybhargavb
Member

ajaybhargavb commented May 2, 2016

The project.json schema has been updated with the following changes,

buildOptions

  • compilationOptions has been renamed to buildOptions
  • compilerName in the root has been moved into buildOptions
  • compile, compileExclude, compileFiles and compileBuiltIn are combined into compile(detailed structure below) under buildOptions
  • resource, resourceExclude, resourceFiles, resourceBuiltIn and namedResource are combined into embed(detailed structure below) under buildOptions
  • content, contentExclude, contentFiles and contentBuiltIn that was used to copy files to build output is being replaced by copyToOutput(detailed structure below) under buildOptions

Example

{
  "buildOptions": {
    "configurations": { },
    "compilerName": "csc",
    "languageVersion": "",
    "warningsAsErrors": true,
    "nowarn": [ ],
    "allowUnsafe": true,
    "emitEntryPoint": true,
    "optimize": true,
    "xmlDoc": false,
    "outputName": "sample",
    "keyFile": "",
    "delaySign": false,
    "publicSign": false,
    "preserveCompilationContext": false,
    "compile": {
        "include": [ "" ],
        "exclude": [ "" ],
        "includeFiles": [ "" ],
        "excludeFiles": [ "" ],
        "builtIns": { },
        "mappings": {
            "dest1": "./src1",
            "dest2": [ "./src2" ]
        }
    },
    "embed": {
        "include": [ "" ],
        "exclude": [ "" ],
        "includeFiles": [ "" ],
        "excludeFiles": [ "" ],
        "builtIns": { },
        "mappings": {
            "dest1": "./src1",
            "dest2": [ "./src2" ]
        }
    },
    "copyToOutput": {
        "include": [ "" ],
        "exclude": [ "" ],
        "includeFiles": [ "" ],
        "excludeFiles": [ "" ],
        "builtIns": { },
        "mappings": {
            "dest/path1": "./src/path1",
            "dest/path2": "./src/path2"
        }
    }
  }
}

publishOptions

  • content, contentExclude, contentFiles, contentBuiltIn and publishExclude that was used to copy files to publish output is being replaced by publishOptions(detailed structure below)

Example

{
  "publishOptions": {
    "include": [ "wwwroot", "Views" ],
    "exclude": [ ],
    "includeFiles": [ ],
    "excludeFiles": [ ],
    "builtIns": [ ],
    "mappings": {
      "dest/path": "./src/path"
    }
  }
}

Note 1: content was used to specify files to be copied both to build output and publish output. That functionality is being split into two using copyToOutput and publishOptions respectively.
Note 2: exclude option which was used to specify common exclusions across compile and resource has been deprecated.

runtimeOptions

runtimeOptions.configProperties includes the following properties:

  • System.GC.Server - Enables/disables server garbage collection.
  • System.GC.Concurrent - Enables/disables concurrent garbage collection.

More configProperties can be found here, and a more detailed description of the runtimeOptions section as a whole can be found here.

Example

"runtimeOptions": {
    "configProperties": {
        "System.GC.Server": true,
        "System.GC.Concurrent": true
    }
}

packOptions

  • The following properties have been moved from the root into packOptions,
    • summary
    • tags
    • owners
    • releaseNotes
    • iconUrl
    • projectUrl
    • licenseUrl
    • requireLicenseAcceptance
    • repository
  • packInclude has been replaced by files(detailed structure below) under packOptions

Example

{
  "packOptions": {
    "summary": "This project is really great.",
    "tags": [ "tag1", "tag2" ],
    "owners": [ "My Name", "Your Name" ],
    "releaseNotes": "Did lots of great things in this release",
    "iconUrl": "https://example.com/an-icon.png",
    "projectUrl": "https://example.com",
    "licenseUrl": "https://example.com/license",
    "requireLicenseAcceptance": false,
    "repository": {
      "type": "git",
      "url": "https://github.com/exampleorg/example"
    },
    "files": {
      "include": "",
      "exclude": "",
      "includeFiles": [ "" ],
      "excludeFiles": [ "" ],
      "builtIns": { },
      "mappings": {
          "dest/path": "./src/path"
      }
    }
  }
}

Structure to include/exclude files

This structure applies to these properties:
compile, embed,copyToOutput, files and publishOptions

  • "include" string/string[]
    A list of file globbing patterns for files to include. The patterns are rooted at the project folder. Defaults to none.
  • "exclude" string/string[]
    A list of file globbing patterns for files to exclude. The exclude patterns have higher priority than the include patterns, hence a file found in both will be excluded. The patterns are rooted at the project folder. Defaults to none.
  • "includeFiles" string/string[]
    A list of file paths to include. The paths are rooted at the project folder. This list has a higher priority than the include and exclude globbing patterns, hence a file listed here and in the exclude globbing pattern will still be included. Defaults to none.
  • "excludeFiles" string/string[]
    A list of file paths to exclude. The paths are rooted at the project folder. This list has a higher priority than globbing patterns and the include paths, hence a file found in all will be excluded. Defaults to none.
  • "builtIns" object
    The defaults provided by the system. It can have include and exclude globbing patterns which are merged with the corresponding values of the include and exclude properties.
    • "include" string/string[]
    • "exclude" string/string[]
  • "mappings" map
    Keys represent destination paths in the output layout, and values are an object representing the source path of files to include which can have its own include, exclude, includeFiles and excludeFiles.
    e.g. "dest/path": "source/path" or "dest/path": { "include": "./src/path" }

Example

{
  "publishOptions": {
    "include": [ "wwwroot", "Views" ],
    "exclude": [ ],
    "includeFiles": [ ],
    "excludeFiles": [ ],
    "builtIns": [ ],
    "mappings": {
      "dest/path": "./src/path"
    }
  }
}

Note: If a string/string[] is specified instead of an object, it will be considered to be part of include.

E.g.

"publishOptions": [ "wwwroot", "Views" ]

is same as

"publishOptions": {
  "include": [ "wwwroot", "Views" ]
}

Note
This change is backwards compatible with the old schema. But there will be warnings during compilation whenever the old schema is used.

Related Issue: dotnet/cli#792

Please use aspnet/Home#1418 for discussion.

@ajaybhargavb ajaybhargavb added this to the 1.0.0-rc2 milestone May 2, 2016

@aspnet aspnet locked and limited conversation to collaborators May 2, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.