Skip to content

Commit fe3781c

Browse files
authored
Merge pull request #84 from Cognifide/vlt-filter-absolute
VLT filter absolute + Gradle & Kotlin upgrade
2 parents 472e8dd + 1654dc6 commit fe3781c

File tree

12 files changed

+30
-24
lines changed

12 files changed

+30
-24
lines changed

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.11'
66+
classpath 'com.cognifide.gradle:aem-plugin:2.0.12'
6767
}
6868
}
6969

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
plugins {
22
id 'java-gradle-plugin'
33
id 'maven-publish'
4-
id "org.jetbrains.kotlin.jvm" version "1.1.4"
4+
id "org.jetbrains.kotlin.jvm" version "1.1.60"
55
id "com.jfrog.bintray" version "1.7.3"
66
}
77

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

@@ -19,7 +19,7 @@ dependencies {
1919
compile gradleApi()
2020
compile localGroovy()
2121

22-
compile "org.jetbrains.kotlin:kotlin-stdlib:1.1.4"
22+
compile "org.jetbrains.kotlin:kotlin-stdlib:1.1.60"
2323
compile 'org.apache.commons:commons-lang3:3.4'
2424
compile 'commons-io:commons-io:2.4'
2525
compile 'commons-httpclient:commons-httpclient:3.1'

gradle/wrapper/gradle-wrapper.jar

-2 Bytes
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Mon Nov 27 15:00:18 CET 2017
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
34
zipStoreBase=GRADLE_USER_HOME
45
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3.1-bin.zip

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ object FileOperations {
7676
fun find(project: Project, dirIfFileName: String, pathOrFileName: String): File? {
7777
return mutableListOf<(String) -> File>(
7878
{ project.file(pathOrFileName) },
79-
{ File(File(dirIfFileName), pathOrFileName) }
79+
{ File(File(dirIfFileName), pathOrFileName) },
80+
{ File(pathOrFileName) }
8081
).map { it(pathOrFileName) }.firstOrNull { it.exists() }
8182
}
8283

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class FileResolver(val project: Project, val downloadDir: File) {
4747
fun attach(task: DefaultTask, prop: String = "fileResolver") {
4848
task.outputs.dir(downloadDir)
4949
project.afterEvaluate {
50-
task.inputs.property(prop, configurationHash)
50+
task.inputs.properties(mapOf(prop to configurationHash))
5151
}
5252
}
5353

src/main/kotlin/com/cognifide/gradle/aem/pkg/ComposeTask.kt

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.cognifide.gradle.aem.pkg
22

33
import com.cognifide.gradle.aem.AemConfig
4+
import com.cognifide.gradle.aem.AemException
45
import com.cognifide.gradle.aem.AemPackagePlugin
56
import com.cognifide.gradle.aem.AemTask
67
import com.cognifide.gradle.aem.internal.Patterns
@@ -93,7 +94,7 @@ open class ComposeTask : Zip(), AemTask {
9394
}
9495

9596
fun includeProject(projectPath: String) {
96-
includeProject(project.findProject(projectPath))
97+
includeProject(findProject(projectPath))
9798
}
9899

99100
fun includeProject(project: Project) {
@@ -120,29 +121,27 @@ open class ComposeTask : Zip(), AemTask {
120121
}
121122

122123
fun includeBundles(projectPath: String) {
123-
val project = project.findProject(projectPath)
124-
125-
includeBundlesAtPath(project)
124+
includeBundlesAtPath(findProject(projectPath))
126125
}
127126

128127
fun includeBundles(project: Project) {
129128
includeBundlesAtPath(project)
130129
}
131130

132131
fun includeBundles(projectPath: String, runMode: String) {
133-
includeBundlesAtPath(project.findProject(projectPath), runMode = runMode)
132+
includeBundlesAtPath(findProject(projectPath), runMode = runMode)
134133
}
135134

136135
fun mergeBundles(projectPath: String) {
137-
includeBundlesAtPath(project.findProject(projectPath))
136+
includeBundlesAtPath(findProject(projectPath))
138137
}
139138

140139
fun mergeBundles(projectPath: String, runMode: String) {
141-
includeBundlesAtPath(project.findProject(projectPath), runMode = runMode)
140+
includeBundlesAtPath(findProject(projectPath), runMode = runMode)
142141
}
143142

144143
fun includeBundlesAtPath(projectPath: String, installPath: String) {
145-
includeBundlesAtPath(project.findProject(projectPath), installPath)
144+
includeBundlesAtPath(findProject(projectPath), installPath)
146145
}
147146

148147
fun includeBundlesAtPath(project: Project, installPath: String? = null, runMode: String? = null) {
@@ -173,7 +172,7 @@ open class ComposeTask : Zip(), AemTask {
173172
}
174173

175174
fun includeContent(projectPath: String) {
176-
includeContent(project.findProject(projectPath))
175+
includeContent(findProject(projectPath))
177176
}
178177

179178
fun includeContent(project: Project) {
@@ -193,8 +192,13 @@ open class ComposeTask : Zip(), AemTask {
193192
}
194193
}
195194

195+
private fun findProject(projectPath: String) : Project {
196+
return project.findProject(projectPath)
197+
?: throw AemException("Project cannot be found by path '$projectPath'")
198+
}
199+
196200
private fun dependProject(projectPath: String, taskNames: Collection<String>) {
197-
dependProject(project.findProject(projectPath), taskNames)
201+
dependProject(findProject(projectPath), taskNames)
198202
}
199203

200204
private fun dependProject(project: Project, taskNames: Collection<String>) {

src/test/kotlin/com/cognifide/gradle/aem/test/ComposeTaskTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ComposeTaskTest : BuildTest() {
3232

3333
assertPackageFile(assemblyPkg, "jcr_root/apps/example/common/.content.xml")
3434
assertPackageFile(assemblyPkg, "jcr_root/apps/example/common/install/common-1.0.0-SNAPSHOT.jar")
35-
assertPackageFile(assemblyPkg, "jcr_root/apps/example/common/install/kotlin-osgi-bundle-1.1.4.jar")
35+
assertPackageFile(assemblyPkg, "jcr_root/apps/example/common/install/kotlin-osgi-bundle-1.1.60.jar")
3636

3737
assertPackageFile(assemblyPkg, "jcr_root/etc/designs/example/.content.xml")
3838

@@ -43,7 +43,7 @@ class ComposeTaskTest : BuildTest() {
4343
val commonPkg = assertPackage(projectDir, "common/build/distributions/example-common-1.0.0-SNAPSHOT.zip")
4444
assertPackageFile(commonPkg, "jcr_root/apps/example/common/.content.xml")
4545
assertPackageFile(commonPkg, "jcr_root/apps/example/common/install/common-1.0.0-SNAPSHOT.jar")
46-
assertPackageFile(commonPkg, "jcr_root/apps/example/common/install/kotlin-osgi-bundle-1.1.4.jar")
46+
assertPackageFile(commonPkg, "jcr_root/apps/example/common/install/kotlin-osgi-bundle-1.1.60.jar")
4747

4848
val designPkg = assertPackage(projectDir, "design/build/distributions/example-design-1.0.0-SNAPSHOT.zip")
4949
assertPackageFile(designPkg, "jcr_root/etc/designs/example/.content.xml")

src/test/resources/com/cognifide/gradle/aem/test/compose/assembly/common/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ bundle {
1919
}
2020

2121
dependencies {
22-
aemInstall group: 'org.jetbrains.kotlin', name: 'kotlin-osgi-bundle', version: '1.1.4'
22+
aemInstall group: 'org.jetbrains.kotlin', name: 'kotlin-osgi-bundle', version: '1.1.60'
2323
aemEmbed group: 'org.hashids', name: 'hashids', version: '1.0.1'
2424
}

src/test/resources/com/cognifide/gradle/aem/test/compose/assembly/gradle/buildscript.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repositories {
77
}
88

99
dependencies {
10-
classpath 'com.cognifide.gradle:aem-plugin:2.0.11'
10+
classpath 'com.cognifide.gradle:aem-plugin:2.0.12'
1111
classpath "org.dm.gradle:gradle-bundle-plugin:0.10.0"
12-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.4"
12+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.60"
1313
}

0 commit comments

Comments
 (0)