Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Add GenAPI to build tools #248

Merged
merged 13 commits into from
Aug 27, 2015
Merged

Add GenAPI to build tools #248

merged 13 commits into from
Aug 27, 2015

Conversation

ericstj
Copy link
Member

@ericstj ericstj commented Aug 26, 2015

This change adds GenAPI to the buildtools repo and a package for shipping the desktop version.

Referencing this package brings in a targets file that emits a CS with file to the output
directory (overridable to any path chosen by the project). In practice I expect projects
to override this to point to a location under source control in another project that builds
the reference assembly.

This can be used to automate the production/update of reference assemblies.
I've chosen to emit source since any API diffs will clearly show up in source control.

This change uncovered a problem in the Microsoft.Cci package which I am fixing internally. I'll update this PR once a new version of that package is published.

ericstj and others added 6 commits August 26, 2015 10:37
…targets

This enables projects in the buildtools repo to use the latest targets
instead of the set that comes from the buildtools package.  Ideally
we can fix the build sequencing in the future to also permit use of
the live task DLL for everything but the Task DLL project.
Currently our projects which required runtime specific assets were referencing those
from the compile graph.  Fix this to actually use the runtime graph.

For non-desktop EXEs we're currently hardcoding win7-x64.  Desktop EXEs are AnyCPU.
I've added two projects following a similar pattern to GenFacades.
They are nearly identical except the desktop version brings in mscorlib-based
refs and resolves against nuget packages as a desktop project.
Referencing this package brings in a targets file that emits a CS with file to the output
directory (overridable to any path chosen by the project).  In practice I expect projects
to override this to point to a location under source control in another project that builds
the reference assembly.

This can be used to automate the production/update of reference assemblies.
I've chosen to emit source since any API diffs will clearly show up in source control.
<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<GenAPITargetPath Condition="'$(GenAPITargetPath)' == ''">$(TargetDir)$(TargetName).cs</GenAPITargetPath>

This comment was marked as spam.

This comment was marked as spam.

@weshaggard
Copy link
Member

Changes LGTM

@ericstj
Copy link
Member Author

ericstj commented Aug 27, 2015

Ok, should be feature complete now. Please have a look.

Aliases were not working at all due to a couple bugs in the parsing logic.
1. We weren't looking for the aliased name
2. After finding the aliased name we missed a case that officialName wasn't used.
3. We weren't setting match when the alias was determined to be the winning match.
This allows folks to specify a file with a copyright/license header to be
prepended to the output of GenAPI.
This allows folks to specify which APIs should be specifically excluded
in addition to other API selection parameters.
Have GenAPI opt into style that is consistent with CoreFx.
The tool was using OpenWrite which will open an existing files at position 0
if it exists.  If the output of the tool happened to be shorter we'd be left with
garbage at the end of the file.  Use CreateText instead.  It will throw away
the contents.
@ericstj
Copy link
Member Author

ericstj commented Aug 27, 2015

Wes reviewed these latest changes over the shoulder and signed off. Merging.

ericstj added a commit that referenced this pull request Aug 27, 2015
@ericstj ericstj merged commit a85b7c4 into dotnet:master Aug 27, 2015
@ericstj ericstj deleted the ericstj/GenAPI branch January 27, 2016 20:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants