Skip to content

Commit 5f23d76

Browse files
author
krystian.panek
committed
Minor fixes
1 parent 5b41595 commit 5f23d76

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ plugins.withId 'cognifide.aem', {
5151
5252
```
5353

54+
Instances configuration can be even omitted, then *http://localhost:4502* and *http://localhost:4503* will be used by default.
55+
Content path can also be skipped, because value above is also default. This is only an example how to customize particular values.
56+
57+
5458
### Sub project (specific)
5559

5660
```
@@ -59,8 +63,8 @@ defaultTasks = ['contentDeploy']
5963
apply plugin: 'cognifide.aem'
6064
6165
aemSatisfy {
62-
local("pkg/apm-2.0.0.zip")
63-
// download("https://github.com/Cognifide/APM/releases/download/cqsm-2.0.0/apm-2.0.0.zip")
66+
// local("pkg/vanityurls-components-1.0.2.zip")
67+
download("https://github.com/Cognifide/APM/releases/download/cqsm-3.0.0/apm-3.0.0.zip")
6468
}
6569
6670
aemCompose {
@@ -76,9 +80,11 @@ task contentDeploy(dependsOn: [clean, build, aemDeploy])
7680
7781
```
7882

83+
Snippet above demonstrates customizations valid only for specific project.
84+
7985
## Tasks
8086

81-
* `aemCompose` - Compose CRX package from JCR content and bundles.
87+
* `aemCompose` - Compose CRX package from JCR content and bundles. Extends ZIP task.
8288
* `aemUpload` - Upload composed CRX package into AEM instance(s).
8389
* `aemInstall` - Install uploaded CRX package on AEM instance(s).
8490
* `aemActivate` - Replicate installed CRX package to other AEM instance(s).

src/main/kotlin/com/cognifide/gradle/aem/deploy/SatisfyTask.kt

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,23 @@ open class SatisfyTask : AbstractTask() {
7171
provide {
7272
val file = File(downloadDir, FilenameUtils.getName(url))
7373

74-
logger.info("Downloading package from URL: $url")
75-
76-
val out = BufferedOutputStream(FileOutputStream(file))
77-
val connection = URL(url).openConnection()
78-
79-
configurer(connection)
80-
connection.getInputStream().use { input ->
81-
out.use { fileOut ->
82-
input.copyTo(fileOut)
74+
if (file.exists()) {
75+
logger.info("Reusing previously downloaded package from URL: $url")
76+
} else {
77+
logger.info("Downloading package from URL: $url")
78+
79+
val out = BufferedOutputStream(FileOutputStream(file))
80+
val connection = URL(url).openConnection()
81+
82+
configurer(connection)
83+
connection.getInputStream().use { input ->
84+
out.use { fileOut ->
85+
input.copyTo(fileOut)
86+
}
8387
}
84-
}
8588

86-
logger.info("Packaged downloaded into path: ${file.absolutePath}")
89+
logger.info("Packaged downloaded into path: ${file.absolutePath}")
90+
}
8791

8892
file
8993
}

0 commit comments

Comments
 (0)