Created
July 31, 2017 23:05
-
-
Save ataylor284/c072c34347393a0aec350fdfa581a527 to your computer and use it in GitHub Desktop.
[nxrm] populate repository with nuget packages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.nio.file.Files | |
import static groovyx.gpars.GParsPool.withPool | |
def N_PACKAGES = 100 | |
withPool { | |
(0..<N_PACKAGES).eachParallel { i -> | |
def dir = new File("package_$i") | |
dir.deleteDir() | |
dir.mkdir() | |
new File("package_$i/Package.nuspec") << | |
"""\ | |
|<?xml version="1.0"?> | |
|<package> | |
| <metadata> | |
| <id>Redtoad.Test$i</id> | |
| <version>1.0.0</version> | |
| <authors>ataylor</authors> | |
| <owners>ataylor</owners> | |
| <projectUrl>https://github.com/ataylor284/nuget-test$i</projectUrl> | |
| <requireLicenseAcceptance>false</requireLicenseAcceptance> | |
| <description>Nuget package test</description> | |
| <releaseNotes>Initial release.</releaseNotes> | |
| <copyright>Copyright 2016</copyright> | |
| <tags>Test Nuget</tags> | |
| </metadata> | |
| <files> | |
| <file src="README.md" target="README.md" /> | |
| <file src="payload*" target="payloads" /> | |
| </files> | |
|</package> | |
|""".stripMargin() | |
Files.copy(new File("README.md").toPath(), new File("package_$i/README.md").toPath()) | |
(0..9).each { f -> | |
new File("package_$i/payload$f") << "payload$f" | |
} | |
"nuget pack".execute(null, dir).waitForProcessOutput(System.out, System.err) | |
"nuget push -Source local Redtoad.Test$i.1.0.0.nupkg".execute(null, dir).waitForProcessOutput(System.out, System.err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment