File tree Expand file tree Collapse file tree
main/kotlin/com/cognifide/gradle/aem
test/resources/com/cognifide/gradle/aem/test Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ buildscript {
115115 }
116116
117117 dependencies {
118- classpath 'com.cognifide.gradle:aem-plugin:3.1.1 '
118+ classpath 'com.cognifide.gradle:aem-plugin:3.1.2 '
119119 }
120120}
121121
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ plugins {
66}
77
88group ' com.cognifide.gradle'
9- version ' 3.1.1 '
9+ version ' 3.1.2 '
1010description = ' Gradle AEM Plugin'
1111defaultTasks = [' clean' , ' build' , ' publishToMavenLocal' ]
1212
Original file line number Diff line number Diff line change @@ -420,7 +420,7 @@ class AemConfig(
420420 * Declare new deployment target (AEM instance).
421421 */
422422 fun localInstance (httpUrl : String ) {
423- instance( LocalInstance .create( httpUrl) )
423+ localInstance( httpUrl, {} )
424424 }
425425
426426 fun localInstance (httpUrl : String , configurer : LocalInstance .() -> Unit ) {
@@ -456,7 +456,7 @@ class AemConfig(
456456 }
457457
458458 fun remoteInstance (httpUrl : String ) {
459- instance( RemoteInstance .create( httpUrl) )
459+ remoteInstance( httpUrl, {} )
460460 }
461461
462462 fun remoteInstance (httpUrl : String , configurer : RemoteInstance .() -> Unit ) {
Original file line number Diff line number Diff line change @@ -124,16 +124,12 @@ interface Instance : Serializable {
124124 return filter(project, RemoteInstance ::class )
125125 }
126126
127- fun portOfUrl (url : String ): Int {
128- return URL (url).port
129- }
130-
131127 }
132128
133129 val httpUrl: String
134130
135131 val httpPort: Int
136- get() = portOfUrl (httpUrl)
132+ get() = InstanceUrl .parse (httpUrl).httpPort
137133
138134 val user: String
139135
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ enum class InstanceType {
2121 }
2222
2323 fun byUrl (url : String ): InstanceType {
24- return byPort(Instance .portOfUrl (url))
24+ return byPort(InstanceUrl .parse (url).httpPort )
2525 }
2626
2727 fun byPort (port : Int ): InstanceType {
Original file line number Diff line number Diff line change @@ -15,7 +15,22 @@ class InstanceUrl(raw: String) {
1515 get() = userPart(1 ) ? : Instance .PASSWORD_DEFAULT
1616
1717 val httpUrl: String
18- get() = " ${config.protocol} ://${config.host} :${config.port} "
18+ get() = if (config.port != - 1 ) {
19+ " ${config.protocol} ://${config.host} :${config.port} "
20+ } else {
21+ " ${config.protocol} ://${config.host} "
22+ }
23+
24+ val httpPort: Int
25+ get() = if (config.port != - 1 ) {
26+ config.port
27+ } else {
28+ if (config.protocol == " https" ) {
29+ 443
30+ } else {
31+ 80
32+ }
33+ }
1934
2035 val typeName: String
2136 get() = InstanceType .nameByUrl(httpUrl)
@@ -24,7 +39,15 @@ class InstanceUrl(raw: String) {
2439 get() = InstanceType .byUrl(httpUrl)
2540
2641 val debugPort: Int
27- get() = " 1${Instance .portOfUrl(httpUrl)} " .toInt()
42+ get() = if (config.port != - 1 ) {
43+ " 1$httpPort " .toInt()
44+ } else {
45+ if (config.protocol == " https" ) {
46+ 50443
47+ } else {
48+ 50080
49+ }
50+ }
2851
2952 private fun userPart (index : Int ): String? {
3053 return config.userInfo?.split(" :" )
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ repositories {
66}
77
88dependencies {
9- classpath ' com.cognifide.gradle:aem-plugin:3.1.1 '
9+ classpath ' com.cognifide.gradle:aem-plugin:3.1.2 '
1010 classpath ' biz.aQute.bnd:biz.aQute.bnd.gradle:3.5.0'
1111 classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.21"
1212}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ buildscript {
66 }
77
88 dependencies {
9- classpath ' com.cognifide.gradle:aem-plugin:3.1.1 '
9+ classpath ' com.cognifide.gradle:aem-plugin:3.1.2 '
1010 classpath ' biz.aQute.bnd:biz.aQute.bnd.gradle:3.5.0'
1111 }
1212}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ buildscript {
66 }
77
88 dependencies {
9- classpath ' com.cognifide.gradle:aem-plugin:3.1.1 '
9+ classpath ' com.cognifide.gradle:aem-plugin:3.1.2 '
1010 }
1111}
1212
You can’t perform that action at this time.
0 commit comments