Skip to content
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

Added BulkReplaceAssemblyInfoVersions #394

Merged
merged 1 commit into from
Apr 14, 2014
Merged

Conversation

DigitalFlow
Copy link
Contributor

Allows to update multiple AssemblyInfo files at once

@forki
Copy link
Member

forki commented Apr 11, 2014

I'd extract the lambda which overwrites the default parameters instead of passing (asmVersion:string) (asmInfoVersion:string) directly.

What do you think about something like the following?

let BulkReplaceAssemblyInfoVersions (dir:string) versionF = 
    let directory = directoryInfo dir
    if directory.Exists then 
        !!(directory.FullName @@ @"\**\Properties\AssemblyInfo.cs")
          |> Seq.iter(fun file ->
             ReplaceAssemblyInfoVersions ((fun p -> {p with OutputFileName = file }) >> versionF))
    else logfn "%s does not exist." directory.FullName

it would allow me to pass all the defined parameters.

@DigitalFlow
Copy link
Contributor Author

I like your solution very much, it makes it possible to configure more parameters without having a huge load of parameters.
I will adopt your way of passing those, will include it in a moment.

@forki
Copy link
Member

forki commented Apr 11, 2014

Also I'm wondering if it would be helpful if the thing would also process F# AssemblyInfo files.

@forki
Copy link
Member

forki commented Apr 11, 2014

And a sample in the docs would be nice. See https://github.com/fsharp/FAKE/blob/develop/src/app/FakeLib/TypeScript.fs#L96

@DigitalFlow
Copy link
Contributor Author

You are right, it should certainly also support F# AssemblyInfo files.
I'll make some thoughts on how to best support both types of AssemblyInfo files, what would you think about adding it as a FileInclude like

!!(directory.FullName @@ @"\**\Properties\AssemblyInfo.cs")
  ++(directory.FullName @@ @"\**\AssemblyInfo.fs")

I will definetly have a look at this sample document and try to add a minimal working example.

@forki
Copy link
Member

forki commented Apr 11, 2014

!! (directory.FullName @@ "**/AssemblyInfo.*s")

should work, but I'm not sure if ReplaceAssemblyInfoVersions works for both types.

@mexx
Copy link
Member

mexx commented Apr 11, 2014

maybe we should reuse ZeroToNine library?

@forki
Copy link
Member

forki commented Apr 11, 2014

what would that give us?

@mexx
Copy link
Member

mexx commented Apr 11, 2014

It supports C#, F# and even VB type of AssemblyInfo files.
Further it can increment a specified version part, which could be a good functionality to have.
Currently it lacks the ability to change the AssemblyInformationalVersion and AssemblyConfiguration, but it could be easily extended.

Actually I got the subject of the issue wrong and thought it's about implementing the ReplaceAssemblyInfoVersions.

@forki
Copy link
Member

forki commented Apr 12, 2014

But we have this functionality - or do I miss something?

@DigitalFlow
Copy link
Contributor Author

Is anyone of you actually developing FAKE on Linux?
Trying to set up the whole project on my home workstation with Fedora 20.
But when running build.sh I get lots of "Error: SendFailure (Error writing headers)" (Mono v3.4.0) and "Unable to find package 'FAKE'" (Mono v2.10.8) messages.

@forki
Copy link
Member

forki commented Apr 12, 2014

I know some people did. And we have a CI build which builds on mono. It's on macos though

@mexx
Copy link
Member

mexx commented Apr 13, 2014

It was just a thought. Never mind.

@forki
Copy link
Member

forki commented Apr 14, 2014

@mexx no honestly. I want to understand your proposal.

forki added a commit that referenced this pull request Apr 14, 2014
Added BulkReplaceAssemblyInfoVersions
@forki forki merged commit ecb51f4 into fsprojects:develop Apr 14, 2014
@mexx
Copy link
Member

mexx commented Apr 14, 2014

@forki as stated in my comment above

I got the subject of the issue wrong and thought it's about implementing the ReplaceAssemblyInfoVersions.

So there is no need for change.

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.

3 participants