Skip to content

Conversation

@Mike-E-angelo
Copy link

- Updated targets to emit References.tt (non-hintpath references). (Issue #3)
- Added .ps1 files to tools path in .nuspec
- Removed Custom Tool from .tt files (Issue #2)
@herskinduk
Copy link
Owner

Thanks for your pull request. I like your changes.

I'm not sure I understand what you are doing with the References.tt? I thought I had that covered in the line 28 of the (missing lol) targets file?

The difference - I output the path of the referenced dll file (fragile guess at it's location) - you just output the name of the assembly? what is the use case for your approach?

@Mike-E-angelo
Copy link
Author

The difference is how the $(SolutionDir) gets emitted and saved on disk. Originally, it was being emitted as the actual hard-coded path (e.g. "C:\Users..."), which would work on a local developer's machine, but not on another. Now it gets emitted as "$(SolutionDir)" which will work on every developer's machine. So now when a developer checks that file in, "$(SolutionDir)" goes into source control and not the hard-coded path. Make sense?

I also realized that I forgot to do this on line 21 as well.

@herskinduk
Copy link
Owner

Ah! I purposely avoided using macros as they do not work outside in the command line. In stead of using macros i would have it generate the file on pre-build.

See how this project came about: http://stackoverflow.com/questions/25990163/using-project-references-as-assembly-paths-in-t4

@Mike-E-angelo
Copy link
Author

AH ok. Well then I guess I haven't thought this through enough, then. If you check this into source control, doesn't the full path go along with the file? And also, have you tried this in a automated build/continuous integration scenario? I believe AssemblyReferences.tt will be read-only and will generate an exception on build, as this task writes to a read-only file...

@herskinduk
Copy link
Owner

I have tried it in a minimal build setup in conjunction with https://github.com/clariuslabs/TransformOnBuild

I am aware that the file will be ever changing and that you would probably not want the AssemblyReferences in your VCS. See issue #7

Re: read-only - this would probably only be an issue if you are using TFS as your VCS.

@Mike-E-angelo
Copy link
Author

Alright, cool. Yeah, T4 is rather a pain when it comes to this stuff. So incredibly frustrating as most of this has already been handled and solved by .*proj files.

As for read-only + TFS... you might just be right on that. I am also thinking about Azure continous deployment but I have no experience with that just yet. Once I do I will let you know how I fare. Thanks again!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants