Skip to content

Commit

Permalink
Merge pull request #116 from jakzal/download-fix
Browse files Browse the repository at this point in the history
Add the "v" prefix back to the version in the download URL
  • Loading branch information
jakzal authored Feb 27, 2024
2 parents a52ef5c + 3c6510f commit 9ef6096
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ class DownloadFunctionalTest : FunctionalTest {
id 'pl.zalas.structurizr-cli'
}
structurizrCli {
version = "2024.01.02"
version = "2024.02.22"
}
""")

execute(projectDir, "structurizrCliDownload")

assertTrue(File("${projectDir.absolutePath}/build/downloads/structurizr-cli-2024.01.02.zip").exists())
assertTrue(File("${projectDir.absolutePath}/build/downloads/structurizr-cli-2024.02.22.zip").exists())
}

@Test
Expand All @@ -46,7 +46,7 @@ class DownloadFunctionalTest : FunctionalTest {
id 'pl.zalas.structurizr-cli'
}
structurizrCli {
version = "2024.01.02"
version = "2024.02.22"
download {
directory = "tmp"
}
Expand All @@ -55,7 +55,7 @@ class DownloadFunctionalTest : FunctionalTest {

execute(projectDir, "structurizrCliDownload")

assertTrue(File("${projectDir.absolutePath}/tmp/structurizr-cli-2024.01.02.zip").exists())
assertTrue(File("${projectDir.absolutePath}/tmp/structurizr-cli-2024.02.22.zip").exists())
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ExtractFunctionalTest : FunctionalTest {
id 'pl.zalas.structurizr-cli'
}
structurizrCli {
version = "2024.01.02"
version = "2024.02.22"
}
""")

Expand Down Expand Up @@ -61,7 +61,7 @@ class ExtractFunctionalTest : FunctionalTest {
id 'pl.zalas.structurizr-cli'
}
structurizrCli {
version = "2024.01.02"
version = "2024.02.22"
extract {
directory = "structurizr-cli"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class StructurizrCliPlugin : Plugin<Project> {
tasks.register("structurizrCliDownload", Download::class.java) { task ->
task.version.set(version.flatMap { it.version })
task.downloadDirectory.set(downloadsDirectory(extension))
task.downloadUrlTemplate.set("https://github.com/structurizr/cli/releases/download/{VERSION}/structurizr-cli.zip")
task.downloadUrlTemplate.set("https://github.com/structurizr/cli/releases/download/v{VERSION}/structurizr-cli.zip")
task.legacyDownloadUrlTemplate.set("https://github.com/structurizr/cli/releases/download/v{VERSION}/structurizr-cli-{VERSION}.zip")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ open class Download : DefaultTask() {
@Input
val version: Property<String> = project.objects.property(String::class.java)

// Example: https://github.com/structurizr/cli/releases/download/2024.01.02/structurizr-cli.zip
// Example: https://github.com/structurizr/cli/releases/download/v2024.01.02/structurizr-cli.zip
@Input
val downloadUrlTemplate: Property<String> = project.objects.property(String::class.java)

Expand Down

0 comments on commit 9ef6096

Please sign in to comment.