Comments (6)
Looking at the source, it looks like I can specify a csprojPath file. But again, it is unsuccessful.
For the version and metadata, the plugin prefers the spec file over the project and the project over the csproj. But again, my nuspec just has
Instead of using the version of the project or the version of the
nugetPack{ csprojPath = file("${project.name}.csproj") }
from gradle-nuget-plugin.
I struggle to understand what you're trying to do sorry.
Maybe you can try running gradle with -i
/--info
so you'll see which nuget command-line is being executed for pack, and let us know what you'd like instead, maybe that'll be clearer ?
Good luck.
from gradle-nuget-plugin.
How is the spec data filled in by the project? Do you have a runtime .targets
file which does the logic? I'm pretty sure this will generate a temporary/intermediate .nuspec, otherwise you'll never be able to generate the final .nupkg if there's not real data in the .nuspec, no? What I mean is, AFAIK nuget doesn't combine info from the .csproj to interpolate the values you mention in the .nuspec.
from gradle-nuget-plugin.
I THOUGHT that is exactly what it was doing - nuget was having the project
fill the spec fields
possibly not using the spec at all and just using the projects attributes.
Not sure. I have very little experience in the non-java domain, I was
sort of thrown into this task. What I do know is I cannot use the plugin
to pack or push, but I can call nuget directly passing in the project file
and it will pack and push. (having to do an extra back flip to get the
version from the AssemblyInfo.cs)
ext['nugetExecutable'] =
"${project.gradle.gradleUserHomeDir}/caches/nuget/${project.extensions.nuget.version}/NuGet.exe"
project.version = getVersion()
ext['nugetPackage'] = "${nugetOutputDir}/${project.name
}.${project.version}.nupkg"
task pack(type:Exec, dependsOn: ['msbuild', 'copyRelease', 'prepack']) {
workingDir "${projectDir}"
executable = "${nugetExecutable}"
args = [
"pack",
"${projectDir}/${project.name}.csproj",
"-OutputDirectory", "${nugetOutputDir}",
"-NonInteractive",
"-Verbosity", "normal"
]
standardOutput = new ByteArrayOutputStream()
ext.output = {
return standardOutput.toString()
}
}
task push(type:Exec, dependsOn:'pack') {
workingDir "${projectDir}"
executable = "${nugetExecutable}"
args = [
"push", "${nugetPackage}",
"-Source", "${ARTIFACTORY_PUBLISHING_REPO}",
"-ApiKey", 'ArtifactorySnapshot',
"-ConfigFile", "${projectDir}/../../NuGet.Config",
"-NonInteractive",
"-Verbosity", "normal"
]
}
def getVersion() {
def ver = ''
def regex = ~/[assembly: AssemblyVersion("(.*)")]/
def matcher = regex.matcher(new File(project.assemblyInfo).text)
while(matcher.find()) {
ver = matcher.group(1)
}
project.version = ver
return ver
}
If nuget can do it, it would be nice if the plugin could as well.
Not exactly sure, but looking at the code it would seem it might if it
didn't pass the -Version when passed a csproj instead of a spec and if it
didn't try to check the spec meta data version first when a csproj file was
passed and recognize a spec file was not supplied.
Thinking about it, not sure why you would want to pass a version to nuget
anyway if the version is already either in the spec or in the csproj?
Help says -Version will override the nuspec version, which doesn't seem
like a good idea unless its being done for build automation. But it
basically negates having an AssemblyInfo->AssemblyVersion AND negates
having the spec file version. Possibly nice if someone really wanted that
behavior, but not in the general case.
On Wed, Oct 26, 2016 at 5:27 AM, Timotei Dolean [email protected]
wrote:
How is the spec data filled in by the project? Do you have a runtime
.targets file which does the logic? I'm pretty sure this will generate a
temporary/intermediate .nuspec, otherwise you'll never be able to generate
the final .nupkg if there's not real data in the .nuspec, no? What I mean
is, AFAIK nuget doesn't combine info from the .csproj to interpolate the
values you mention in the .nuspec.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#51 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIaeHtOJ90MrewiFgG_XYi-hMAd8td8Pks5q3x0MgaJpZM4KgSkX
.
from gradle-nuget-plugin.
FYI: confirmed the spec meta data is being populated from the AssemblyInfo.cs attributes.
from gradle-nuget-plugin.
nuspec data can be defined in build.gradle already
from gradle-nuget-plugin.
Related Issues (20)
- Allow ad-hoc location to NuGet Executable HOT 3
- Project configuration fails without nugetSources section in build.gradle HOT 4
- Plugin cannot be released by gradle 4.9
- Timescale for 2.18? HOT 1
- Plugin won't work for Azure NuGet 3
- HOTWO nugetSpec and list of files? HOT 1
- The process cannot access the file 'fileContent.lock' because it is being used by another process HOT 1
- The distsDir method has been deprecated. This is scheduled to be removed in Gradle 6.0.
- Property is not annotated with an input or output annotation. This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0. HOT 3
- Could not generate a decorated class for type NuGetPush HOT 4
- nugetRestore also triggers nugetSources with error HOT 1
- Solution file argument isn't being passed
- Gradle 7.0 - No such property: UPLOAD_GROUP HOT 1
- deprecated feature warning in Gradle 7.0.2
- Additional task "nugetInstall"
- nugetPack.basePath incorrect annotated as a file
- NuGetPack.getIdFromMsbuildTask got broken by csprojPath type change
- Collision when downloading nuget in multiple sub projects HOT 1
- Could not set unknown property 'nugetExePath' for extension 'nuget' of type com.ullink.NuGetExtension. HOT 1
- Gradle 8 - update version and use providers on Task objects
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-nuget-plugin.