Skip to content

Commit 431138c

Browse files
authored
Merge pull request #68 from Cognifide/vlt-clean-edge-case
VLT clean edge case
2 parents 2614046 + c63bfbf commit 431138c

17 files changed

Lines changed: 180 additions & 39 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ buildscript {
6363
}
6464
6565
dependencies {
66-
classpath 'com.cognifide.gradle:aem-plugin:2.0.7'
66+
classpath 'com.cognifide.gradle:aem-plugin:2.0.8'
6767
}
6868
}
6969

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
}
77

88
group 'com.cognifide.gradle'
9-
version '2.0.8-SNAPSHOT'
9+
version '2.0.8'
1010
description = 'Gradle AEM Plugin'
1111
defaultTasks = ['clean', 'publishToMavenLocal']
1212

src/main/kotlin/com/cognifide/gradle/aem/AemConfig.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ open class AemConfig(project: Project) : Serializable {
8686
var deployParallel: Boolean = false
8787

8888
/**
89-
* CRX package name conventions indicating that package can change over time while having
90-
* same version specified.
89+
* CRX package name conventions (with wildcard) indicating that package can change over time
90+
* while having same version specified.
9191
*/
9292
@Input
93-
var deploySnapshots: List<String> = mutableListOf("**/*-SNAPSHOT.zip")
93+
var deploySnapshots: List<String> = mutableListOf()
9494

9595
/**
9696
* Force upload CRX package regardless if it was previously uploaded.

src/main/kotlin/com/cognifide/gradle/aem/instance/Instance.kt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,16 @@ interface Instance : Serializable {
6464
fun filter(project: Project, instanceFilter: String = FILTER_LOCAL): List<Instance> {
6565
val config = AemConfig.of(project)
6666
val instanceValues = project.properties[LIST_PROP] as String?
67-
if (!instanceValues.isNullOrBlank()) {
68-
return parse(instanceValues!!)
69-
}
7067

71-
val instances = if (config.instances.values.isEmpty()) {
72-
return defaults()
68+
val instances = if (!instanceValues.isNullOrBlank()) {
69+
parse(instanceValues!!)
70+
} else if (!config.instances.values.isEmpty()) {
71+
config.instances.values
7372
} else {
74-
config.instances
73+
defaults()
7574
}
7675

77-
return instances.values.filter { instance ->
76+
return instances.filter { instance ->
7877
PropertyParser(project).filter(instance.name, NAME_PROP, instanceFilter)
7978
}
8079
}

src/main/kotlin/com/cognifide/gradle/aem/internal/file/DownloadException.kt renamed to src/main/kotlin/com/cognifide/gradle/aem/internal/file/FileException.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package com.cognifide.gradle.aem.internal.file
22

33
import com.cognifide.gradle.aem.AemException
44

5-
class DownloadException : AemException {
5+
class FileException : AemException {
66

77
constructor(message: String, cause: Throwable) : super(message, cause)
88

src/main/kotlin/com/cognifide/gradle/aem/internal/file/FileResolver.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ class FileResolver(val project: Project, val downloadDir: File) {
218218

219219
@Synchronized
220220
fun group(name: String, configurer: Closure<*>) {
221+
if (resolvers.any { it.group == name }) {
222+
throw FileException("File group to be resolved named '$name' is already defined for download dir: $downloadDir")
223+
}
224+
221225
group = name
222226
ConfigureUtil.configureSelf(configurer, this)
223227
group = GROUP_DEFAULT

src/main/kotlin/com/cognifide/gradle/aem/internal/file/HttpFileDownloader.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class HttpFileDownloader(val project: Project) {
4949

5050
downloader.download(response.entity.content, targetFile)
5151
} catch (e: Exception) {
52-
throw DownloadException("Cannot download URL '$sourceUrl' to file '$targetFile' using HTTP(s). Check connection.", e)
52+
throw FileException("Cannot download URL '$sourceUrl' to file '$targetFile' using HTTP(s). Check connection.", e)
5353
}
5454
}
5555

src/main/kotlin/com/cognifide/gradle/aem/internal/file/SftpFileDownloader.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class SftpFileDownloader(val project: Project) {
3939
downloader.download(input, targetFile)
4040
})
4141
} catch (e: Exception) {
42-
throw DownloadException("Cannot download URL '$sourceUrl' to file '$targetFile' using SFTP. Check connection.", e)
42+
throw FileException("Cannot download URL '$sourceUrl' to file '$targetFile' using SFTP. Check connection.", e)
4343
}
4444
}
4545

src/main/kotlin/com/cognifide/gradle/aem/internal/file/SmbFileDownloader.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SmbFileDownloader(val project: Project) {
2929

3030
downloader.download(smbFile.inputStream, targetFile)
3131
} catch (e: Exception) {
32-
throw DownloadException("Cannot download URL '$sourceUrl' to file '$targetFile' using SMB. Check connection.", e)
32+
throw FileException("Cannot download URL '$sourceUrl' to file '$targetFile' using SMB. Check connection.", e)
3333
}
3434
}
3535

src/main/kotlin/com/cognifide/gradle/aem/internal/file/UrlFileDownloader.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class UrlFileDownloader(val project: Project) {
2727

2828
downloader.download(connection.getInputStream(), targetFile)
2929
} catch (e: Exception) {
30-
throw DownloadException("Cannot download URL '$sourceUrl' to file '$targetFile'.", e)
30+
throw FileException("Cannot download URL '$sourceUrl' to file '$targetFile'.", e)
3131
}
3232
}
3333

0 commit comments

Comments
 (0)