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

Update broke our NuGetPack process #643

Closed
jamescrowley opened this issue Feb 3, 2015 · 10 comments
Closed

Update broke our NuGetPack process #643

jamescrowley opened this issue Feb 3, 2015 · 10 comments

Comments

@jamescrowley
Copy link
Contributor

Can anyone explain the purpose of this commit:

2ddc4d4

? It's broken our build script when we just updated our FAKE version.

We previously did:

    Target "Package" (fun _ ->
        !! (currentDirectory @@ "db" @@ "Database.nuspec")
        |>  Seq.iter (NuGetPack (fun param -> { param with 
                                                ToolPath = nuGetPath
                                                OutputPath = artifactsDir
                                                WorkingDir = currentDirectory
                                                IncludeReferencedProjects = true
                                                Version = buildVersion
                                                Properties = [("Configuration", buildMode)] }))
    )

but now Database.nuspec is written to the root of our project (currentDirectory), and then packages up our entire source code tree. Previously it just ran nuget pack on the nuspec file in the db directory and packaged that up.

I'd fix this but I don't understand the new behavior caused by
2ddc4d4 enough - why is it always writing (and deleting) a nuspec file even if you're giving it one that exists?

@forki
Copy link
Member

forki commented Feb 3, 2015

I think you need to set the working dir to currentDirectory @@ "db"

@forki
Copy link
Member

forki commented Feb 3, 2015

@ilkerde do you remember what changed?

@jamescrowley
Copy link
Contributor Author

@forki that's what I've been trying as a fix, but this then breaks subsequent items:

Target "Package" (fun _ ->
    !! (currentDirectory @@ "db" @@ "Database.nuspec")
    ++ (currentDirectory @@ "rules" @@ "Rules.nuspec")
    ++ (currentDirectory @@ "src" @@ "TestApi" @@ "TestApi.csproj")
    |>  Seq.iter (fun path -> 
        path |> NuGetPack (fun param -> { param with 
                                            ToolPath = nuGetPath
                                            OutputPath = artifactsDir
                                            WorkingDir = Path.GetDirectoryName(path)
                                            IncludeReferencedProjects = true
                                            Version = buildVersion
                                            Properties = [("Configuration", buildMode)] }))
)

@jamescrowley
Copy link
Contributor Author

The db nuget package gets created okay with the above fix, but I then get

   Creating .nuspec file at src\TestApi\TestApi.csproj0.0.0.0-beta.nuspec
   Created nuspec file src\TestApi\TestApi.csproj0.0.0.0-beta.nuspec

which I haven't figured out yet, which aside from the weird paths then blows up with

  The 'http://schemas.microsoft.com/developer/msbuild/2003:Project' element is not

declared.

@forki
Copy link
Member

forki commented Feb 3, 2015

why is it always writing (and deleting) a nuspec file even if you're giving it one that exists?

IIRC because we want to replace placeholders.

@jamescrowley
Copy link
Contributor Author

I think this last bit is because it's copied the .csproj file as if it was a nuspec file?

@jamescrowley
Copy link
Contributor Author

Pretty sure this is a bug now. We're relying on NuGet pack behaviour such that you can pass in a .csproj file, and have a .nuspec on the filesystem alongside it, and nuget will combine the two. Pretty sure this templating (even ignoring the bad copying of the .csproj) would break this.

@forki
Copy link
Member

forki commented Feb 3, 2015

I never knew we supported this scenario ;-)
Can you come up with a fix which enables both?

@ilkerde
Copy link
Contributor

ilkerde commented Feb 3, 2015

@forki Thanks for letting me know about this. Maybe I can add some value to this discussion.

@jamescrowley I think my pull request to this commit is descriptive in terms of why I did this. (see: #554). The reason why it is creating and deleting the (intermediate) .nuspec file is because NugetPack supports transforming a nuspec template now. I chose to copy this "strategy" of nuspec preparation from the original Nuget implementation. That is, this create/delete thing was kind of always there for Nuget. I just introduced it for NugetPack as well. Aside, I (somewhat) kept backwards compatibility since the original version expected a plain (ready to go) .nuspec file only, without any placeholders in there. That's basically the story.

Hope it helps at least.

@dsyme
Copy link
Collaborator

dsyme commented Oct 1, 2016

This is a discussion about an old update. Closing as it's not got a clear repro now

@dsyme dsyme closed this as completed Oct 1, 2016
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

No branches or pull requests

4 participants