Plugin install process pb

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Plugin install process pb

Olivier.heintz
Hi,

In my environment (Linux,  openjdk version "1.8.0_171") plugin install process does not work any more since this commit (june, 20)

 def taskExistsInproject(fullyQualifiedProject, taskName) {
-    def taskExists = false
-    subprojects.each { subProject ->
-        if (subProject.getPath().equals(fullyQualifiedProject.toString())) {
-            subProject.tasks.each { projTask ->
-                if (taskName.equals(projTask.name)) {
-                    taskExists = true
-                }
-            }
-        }
-    }
-    return taskExists
+    subprojects.stream()
+        .filter { it.path == fullyQualifiedProject.toString() }
+        .flatMap { it.tasks.stream() }
+        .anyMatch taskName.&equals
 }


When I try to install the message is

 ./gradlew installPlugin -PpluginId=testPlugin1
:installPlugin
No install task defined for plugin testPlugin1, nothing to do

BUILD SUCCESSFUL

Total time: 1.516 secs


My testPlugin1 build.gradle is very simple
task install {
        doLast {
                println 'install task for my plugin test1'
                exec{ commandLine 'echo', 'Bonjour' } // this could be what you want
        }
}

task uninstall {
        doLast {
                println 'un-install task for my plugin test1'
                exec{ commandLine 'echo', 'Au-revoir' } // this could be what you want
        }
}

task hello {
        doLast {
           println 'tutorialspoint'
        }
}



with the previous version of taskExistsInproject  it works

└─$ ./gradlew installPlugin -PpluginId=testPlugin1
:plugins:testPlugin1:install
install task for my plugin test1
Bonjour
:installPlugin
installed plugin testPlugin1

BUILD SUCCESSFUL

Total time: 3.134 secs
Reply | Threaded
Open this post in threaded view
|

Re: Plugin install process pb

taher
Hi Olivier,

Can you confirm that if you test _before_ this commit that it works?
If yes, then this commit needs to be reverted.
On Mon, Aug 13, 2018 at 1:22 PM Olivier Heintz
<[hidden email]> wrote:

>
> Hi,
>
> In my environment (Linux,  openjdk version "1.8.0_171") plugin install process does not work any more since this commit (june, 20)
>
>  def taskExistsInproject(fullyQualifiedProject, taskName) {
> -    def taskExists = false
> -    subprojects.each { subProject ->
> -        if (subProject.getPath().equals(fullyQualifiedProject.toString())) {
> -            subProject.tasks.each { projTask ->
> -                if (taskName.equals(projTask.name)) {
> -                    taskExists = true
> -                }
> -            }
> -        }
> -    }
> -    return taskExists
> +    subprojects.stream()
> +        .filter { it.path == fullyQualifiedProject.toString() }
> +        .flatMap { it.tasks.stream() }
> +        .anyMatch taskName.&equals
>  }
>
>
> When I try to install the message is
>
>  ./gradlew installPlugin -PpluginId=testPlugin1
> :installPlugin
> No install task defined for plugin testPlugin1, nothing to do
>
> BUILD SUCCESSFUL
>
> Total time: 1.516 secs
>
>
> My testPlugin1 build.gradle is very simple
> task install {
>         doLast {
>                 println 'install task for my plugin test1'
>                 exec{ commandLine 'echo', 'Bonjour' } // this could be what you want
>         }
> }
>
> task uninstall {
>         doLast {
>                 println 'un-install task for my plugin test1'
>                 exec{ commandLine 'echo', 'Au-revoir' } // this could be what you want
>         }
> }
>
> task hello {
>         doLast {
>            println 'tutorialspoint'
>         }
> }
>
>
>
> with the previous version of taskExistsInproject  it works
>
> └─$ ./gradlew installPlugin -PpluginId=testPlugin1
> :plugins:testPlugin1:install
> install task for my plugin test1
> Bonjour
> :installPlugin
> installed plugin testPlugin1
>
> BUILD SUCCESSFUL
>
> Total time: 3.134 secs
Reply | Threaded
Open this post in threaded view
|

Re: Plugin install process pb

Olivier.heintz
Yes, I confirm, with the old code it works
( I have found which commit after multiple test, each one for each commit on build.gradle ;-) )

Le 13/08/2018 à 14:12, Taher Alkhateeb a écrit :

> Hi Olivier,
>
> Can you confirm that if you test _before_ this commit that it works?
> If yes, then this commit needs to be reverted.
> On Mon, Aug 13, 2018 at 1:22 PM Olivier Heintz
> <[hidden email]> wrote:
>>
>> Hi,
>>
>> In my environment (Linux,  openjdk version "1.8.0_171") plugin install process does not work any more since this commit (june, 20)
>>
>>  def taskExistsInproject(fullyQualifiedProject, taskName) {
>> -    def taskExists = false
>> -    subprojects.each { subProject ->
>> -        if (subProject.getPath().equals(fullyQualifiedProject.toString())) {
>> -            subProject.tasks.each { projTask ->
>> -                if (taskName.equals(projTask.name)) {
>> -                    taskExists = true
>> -                }
>> -            }
>> -        }
>> -    }
>> -    return taskExists
>> +    subprojects.stream()
>> +        .filter { it.path == fullyQualifiedProject.toString() }
>> +        .flatMap { it.tasks.stream() }
>> +        .anyMatch taskName.&equals
>>  }
>>
>>
>> When I try to install the message is
>>
>>  ./gradlew installPlugin -PpluginId=testPlugin1
>> :installPlugin
>> No install task defined for plugin testPlugin1, nothing to do
>>
>> BUILD SUCCESSFUL
>>
>> Total time: 1.516 secs
>>
>>
>> My testPlugin1 build.gradle is very simple
>> task install {
>>         doLast {
>>                 println 'install task for my plugin test1'
>>                 exec{ commandLine 'echo', 'Bonjour' } // this could be what you want
>>         }
>> }
>>
>> task uninstall {
>>         doLast {
>>                 println 'un-install task for my plugin test1'
>>                 exec{ commandLine 'echo', 'Au-revoir' } // this could be what you want
>>         }
>> }
>>
>> task hello {
>>         doLast {
>>            println 'tutorialspoint'
>>         }
>> }
>>
>>
>>
>> with the previous version of taskExistsInproject  it works
>>
>> └─$ ./gradlew installPlugin -PpluginId=testPlugin1
>> :plugins:testPlugin1:install
>> install task for my plugin test1
>> Bonjour
>> :installPlugin
>> installed plugin testPlugin1
>>
>> BUILD SUCCESSFUL
>>
>> Total time: 3.134 secs
>
Reply | Threaded
Open this post in threaded view
|

Re: Plugin install process pb

Jacques Le Roux
Administrator
Hi Olivier,

Did you try with an Oracle JDK? Also which Linux distribution/version are you using?

Jacques


Le 13/08/2018 à 16:28, Olivier Heintz a écrit :

> Yes, I confirm, with the old code it works
> ( I have found which commit after multiple test, each one for each commit on build.gradle ;-) )
>
> Le 13/08/2018 à 14:12, Taher Alkhateeb a écrit :
>> Hi Olivier,
>>
>> Can you confirm that if you test _before_ this commit that it works?
>> If yes, then this commit needs to be reverted.
>> On Mon, Aug 13, 2018 at 1:22 PM Olivier Heintz
>> <[hidden email]> wrote:
>>> Hi,
>>>
>>> In my environment (Linux,  openjdk version "1.8.0_171") plugin install process does not work any more since this commit (june, 20)
>>>
>>>   def taskExistsInproject(fullyQualifiedProject, taskName) {
>>> -    def taskExists = false
>>> -    subprojects.each { subProject ->
>>> -        if (subProject.getPath().equals(fullyQualifiedProject.toString())) {
>>> -            subProject.tasks.each { projTask ->
>>> -                if (taskName.equals(projTask.name)) {
>>> -                    taskExists = true
>>> -                }
>>> -            }
>>> -        }
>>> -    }
>>> -    return taskExists
>>> +    subprojects.stream()
>>> +        .filter { it.path == fullyQualifiedProject.toString() }
>>> +        .flatMap { it.tasks.stream() }
>>> +        .anyMatch taskName.&equals
>>>   }
>>>
>>>
>>> When I try to install the message is
>>>
>>>   ./gradlew installPlugin -PpluginId=testPlugin1
>>> :installPlugin
>>> No install task defined for plugin testPlugin1, nothing to do
>>>
>>> BUILD SUCCESSFUL
>>>
>>> Total time: 1.516 secs
>>>
>>>
>>> My testPlugin1 build.gradle is very simple
>>> task install {
>>>          doLast {
>>>                  println 'install task for my plugin test1'
>>>                  exec{ commandLine 'echo', 'Bonjour' } // this could be what you want
>>>          }
>>> }
>>>
>>> task uninstall {
>>>          doLast {
>>>                  println 'un-install task for my plugin test1'
>>>                  exec{ commandLine 'echo', 'Au-revoir' } // this could be what you want
>>>          }
>>> }
>>>
>>> task hello {
>>>          doLast {
>>>             println 'tutorialspoint'
>>>          }
>>> }
>>>
>>>
>>>
>>> with the previous version of taskExistsInproject  it works
>>>
>>> └─$ ./gradlew installPlugin -PpluginId=testPlugin1
>>> :plugins:testPlugin1:install
>>> install task for my plugin test1
>>> Bonjour
>>> :installPlugin
>>> installed plugin testPlugin1
>>>
>>> BUILD SUCCESSFUL
>>>
>>> Total time: 3.134 secs

Reply | Threaded
Open this post in threaded view
|

Re: Plugin install process pb

taher
I doubt the JDK has anything to do with this. Probably a syntax issue is
the root cause.

On Mon, Aug 13, 2018, 5:36 PM Jacques Le Roux <[hidden email]>
wrote:

> Hi Olivier,
>
> Did you try with an Oracle JDK? Also which Linux distribution/version are
> you using?
>
> Jacques
>
>
> Le 13/08/2018 à 16:28, Olivier Heintz a écrit :
> > Yes, I confirm, with the old code it works
> > ( I have found which commit after multiple test, each one for each
> commit on build.gradle ;-) )
> >
> > Le 13/08/2018 à 14:12, Taher Alkhateeb a écrit :
> >> Hi Olivier,
> >>
> >> Can you confirm that if you test _before_ this commit that it works?
> >> If yes, then this commit needs to be reverted.
> >> On Mon, Aug 13, 2018 at 1:22 PM Olivier Heintz
> >> <[hidden email]> wrote:
> >>> Hi,
> >>>
> >>> In my environment (Linux,  openjdk version "1.8.0_171") plugin install
> process does not work any more since this commit (june, 20)
> >>>
> >>>   def taskExistsInproject(fullyQualifiedProject, taskName) {
> >>> -    def taskExists = false
> >>> -    subprojects.each { subProject ->
> >>> -        if
> (subProject.getPath().equals(fullyQualifiedProject.toString())) {
> >>> -            subProject.tasks.each { projTask ->
> >>> -                if (taskName.equals(projTask.name)) {
> >>> -                    taskExists = true
> >>> -                }
> >>> -            }
> >>> -        }
> >>> -    }
> >>> -    return taskExists
> >>> +    subprojects.stream()
> >>> +        .filter { it.path == fullyQualifiedProject.toString() }
> >>> +        .flatMap { it.tasks.stream() }
> >>> +        .anyMatch taskName.&equals
> >>>   }
> >>>
> >>>
> >>> When I try to install the message is
> >>>
> >>>   ./gradlew installPlugin -PpluginId=testPlugin1
> >>> :installPlugin
> >>> No install task defined for plugin testPlugin1, nothing to do
> >>>
> >>> BUILD SUCCESSFUL
> >>>
> >>> Total time: 1.516 secs
> >>>
> >>>
> >>> My testPlugin1 build.gradle is very simple
> >>> task install {
> >>>          doLast {
> >>>                  println 'install task for my plugin test1'
> >>>                  exec{ commandLine 'echo', 'Bonjour' } // this could
> be what you want
> >>>          }
> >>> }
> >>>
> >>> task uninstall {
> >>>          doLast {
> >>>                  println 'un-install task for my plugin test1'
> >>>                  exec{ commandLine 'echo', 'Au-revoir' } // this could
> be what you want
> >>>          }
> >>> }
> >>>
> >>> task hello {
> >>>          doLast {
> >>>             println 'tutorialspoint'
> >>>          }
> >>> }
> >>>
> >>>
> >>>
> >>> with the previous version of taskExistsInproject  it works
> >>>
> >>> └─$ ./gradlew installPlugin -PpluginId=testPlugin1
> >>> :plugins:testPlugin1:install
> >>> install task for my plugin test1
> >>> Bonjour
> >>> :installPlugin
> >>> installed plugin testPlugin1
> >>>
> >>> BUILD SUCCESSFUL
> >>>
> >>> Total time: 3.134 secs
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Plugin install process pb

Olivier.heintz
In reply to this post by Jacques Le Roux
I'm on a debian stretch,

I'm just testing with a ubuntu 18.04 and Oracle JDK and there is then same message

No install task defined for plugin testPlugin1, nothing to do




Le 13/08/2018 à 16:36, Jacques Le Roux a écrit :

> Hi Olivier,
>
> Did you try with an Oracle JDK? Also which Linux distribution/version are you using?
>
> Jacques
>
>
> Le 13/08/2018 à 16:28, Olivier Heintz a écrit :
>> Yes, I confirm, with the old code it works
>> ( I have found which commit after multiple test, each one for each commit on build.gradle ;-) )
>>
>> Le 13/08/2018 à 14:12, Taher Alkhateeb a écrit :
>>> Hi Olivier,
>>>
>>> Can you confirm that if you test _before_ this commit that it works?
>>> If yes, then this commit needs to be reverted.
>>> On Mon, Aug 13, 2018 at 1:22 PM Olivier Heintz
>>> <[hidden email]> wrote:
>>>> Hi,
>>>>
>>>> In my environment (Linux,  openjdk version "1.8.0_171") plugin install process does not work any more since this commit (june, 20)
>>>>
>>>>   def taskExistsInproject(fullyQualifiedProject, taskName) {
>>>> -    def taskExists = false
>>>> -    subprojects.each { subProject ->
>>>> -        if (subProject.getPath().equals(fullyQualifiedProject.toString())) {
>>>> -            subProject.tasks.each { projTask ->
>>>> -                if (taskName.equals(projTask.name)) {
>>>> -                    taskExists = true
>>>> -                }
>>>> -            }
>>>> -        }
>>>> -    }
>>>> -    return taskExists
>>>> +    subprojects.stream()
>>>> +        .filter { it.path == fullyQualifiedProject.toString() }
>>>> +        .flatMap { it.tasks.stream() }
>>>> +        .anyMatch taskName.&equals
>>>>   }
>>>>
>>>>
>>>> When I try to install the message is
>>>>
>>>>   ./gradlew installPlugin -PpluginId=testPlugin1
>>>> :installPlugin
>>>> No install task defined for plugin testPlugin1, nothing to do
>>>>
>>>> BUILD SUCCESSFUL
>>>>
>>>> Total time: 1.516 secs
>>>>
>>>>
>>>> My testPlugin1 build.gradle is very simple
>>>> task install {
>>>>          doLast {
>>>>                  println 'install task for my plugin test1'
>>>>                  exec{ commandLine 'echo', 'Bonjour' } // this could be what you want
>>>>          }
>>>> }
>>>>
>>>> task uninstall {
>>>>          doLast {
>>>>                  println 'un-install task for my plugin test1'
>>>>                  exec{ commandLine 'echo', 'Au-revoir' } // this could be what you want
>>>>          }
>>>> }
>>>>
>>>> task hello {
>>>>          doLast {
>>>>             println 'tutorialspoint'
>>>>          }
>>>> }
>>>>
>>>>
>>>>
>>>> with the previous version of taskExistsInproject  it works
>>>>
>>>> └─$ ./gradlew installPlugin -PpluginId=testPlugin1
>>>> :plugins:testPlugin1:install
>>>> install task for my plugin test1
>>>> Bonjour
>>>> :installPlugin
>>>> installed plugin testPlugin1
>>>>
>>>> BUILD SUCCESSFUL
>>>>
>>>> Total time: 3.134 secs
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Plugin install process pb

Mathieu Lirzin
In reply to this post by Olivier.heintz
Hello,

Just to let you know that I have been able to reproduce the bug, and I
am working on fixing it.

Olivier Heintz <[hidden email]> writes:

> In my environment (Linux,  openjdk version "1.8.0_171") plugin install process does not work any more since this commit (june, 20)
>
>  def taskExistsInproject(fullyQualifiedProject, taskName) {
> -    def taskExists = false
> -    subprojects.each { subProject ->
> -        if (subProject.getPath().equals(fullyQualifiedProject.toString())) {
> -            subProject.tasks.each { projTask ->
> -                if (taskName.equals(projTask.name)) {
> -                    taskExists = true
> -                }
> -            }
> -        }
> -    }
> -    return taskExists
> +    subprojects.stream()
> +        .filter { it.path == fullyQualifiedProject.toString() }
> +        .flatMap { it.tasks.stream() }
> +        .anyMatch taskName.&equals
>  }
>
>
> When I try to install the message is
>
>  ./gradlew installPlugin -PpluginId=testPlugin1
> :installPlugin
> No install task defined for plugin testPlugin1, nothing to do
>
> BUILD SUCCESSFUL
>
> Total time: 1.516 secs
>
>
> My testPlugin1 build.gradle is very simple
> task install {
> doLast {
> println 'install task for my plugin test1'
> exec{ commandLine 'echo', 'Bonjour' } // this could be what you want
> }
> }
>
> task uninstall {
> doLast {
> println 'un-install task for my plugin test1'
> exec{ commandLine 'echo', 'Au-revoir' } // this could be what you want
> }
> }
>
> task hello {
> doLast {
>   println 'tutorialspoint'
> }
> }
>
>
>
> with the previous version of taskExistsInproject  it works
>
> └─$ ./gradlew installPlugin -PpluginId=testPlugin1
> :plugins:testPlugin1:install
> install task for my plugin test1
> Bonjour
> :installPlugin
> installed plugin testPlugin1
>
> BUILD SUCCESSFUL
>
> Total time: 3.134 secs

--
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37
Reply | Threaded
Open this post in threaded view
|

Re: Plugin install process pb

Mathieu Lirzin
Hello again,

Mathieu Lirzin <[hidden email]> writes:

>> In my environment (Linux,  openjdk version "1.8.0_171") plugin install process does not work any more since this commit (june, 20)
>>
>>  def taskExistsInproject(fullyQualifiedProject, taskName) {
>> -    def taskExists = false
>> -    subprojects.each { subProject ->
>> -        if (subProject.getPath().equals(fullyQualifiedProject.toString())) {
>> -            subProject.tasks.each { projTask ->
>> -                if (taskName.equals(projTask.name)) {
>> -                    taskExists = true
>> -                }
>> -            }
>> -        }
>> -    }
>> -    return taskExists
>> +    subprojects.stream()
>> +        .filter { it.path == fullyQualifiedProject.toString() }
>> +        .flatMap { it.tasks.stream() }
>> +        .anyMatch taskName.&equals
>>  }
The problem is that ‘taskName’ is compares with a task instead of the
task ‘name’ property.  Here is a patch that fixes the bug.


diff --git build.gradle build.gradle
index d326d10f3a..42eb3d5254 100644
--- build.gradle
+++ build.gradle
@@ -1037,7 +1037,7 @@ def taskExistsInproject(fullyQualifiedProject, taskName) {
     subprojects.stream()
         .filter { it.path == fullyQualifiedProject.toString() }
         .flatMap { it.tasks.stream() }
-        .anyMatch taskName.&equals
+        .anyMatch { it.name == taskName }
 }
 
 def gradlewSubprocess(commandList) {


Thanks.

--
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37
Reply | Threaded
Open this post in threaded view
|

Re: Plugin install process pb

Jacques Le Roux
Administrator
In reply to this post by Mathieu Lirzin
Good news, thanks Mathieu

Jacques


Le 13/08/2018 à 18:02, Mathieu Lirzin a écrit :

> Hello,
>
> Just to let you know that I have been able to reproduce the bug, and I
> am working on fixing it.
>
> Olivier Heintz <[hidden email]> writes:
>
>> In my environment (Linux,  openjdk version "1.8.0_171") plugin install process does not work any more since this commit (june, 20)
>>
>>   def taskExistsInproject(fullyQualifiedProject, taskName) {
>> -    def taskExists = false
>> -    subprojects.each { subProject ->
>> -        if (subProject.getPath().equals(fullyQualifiedProject.toString())) {
>> -            subProject.tasks.each { projTask ->
>> -                if (taskName.equals(projTask.name)) {
>> -                    taskExists = true
>> -                }
>> -            }
>> -        }
>> -    }
>> -    return taskExists
>> +    subprojects.stream()
>> +        .filter { it.path == fullyQualifiedProject.toString() }
>> +        .flatMap { it.tasks.stream() }
>> +        .anyMatch taskName.&equals
>>   }
>>
>>
>> When I try to install the message is
>>
>>   ./gradlew installPlugin -PpluginId=testPlugin1
>> :installPlugin
>> No install task defined for plugin testPlugin1, nothing to do
>>
>> BUILD SUCCESSFUL
>>
>> Total time: 1.516 secs
>>
>>
>> My testPlugin1 build.gradle is very simple
>> task install {
>> doLast {
>> println 'install task for my plugin test1'
>> exec{ commandLine 'echo', 'Bonjour' } // this could be what you want
>> }
>> }
>>
>> task uninstall {
>> doLast {
>> println 'un-install task for my plugin test1'
>> exec{ commandLine 'echo', 'Au-revoir' } // this could be what you want
>> }
>> }
>>
>> task hello {
>> doLast {
>>   println 'tutorialspoint'
>> }
>> }
>>
>>
>>
>> with the previous version of taskExistsInproject  it works
>>
>> └─$ ./gradlew installPlugin -PpluginId=testPlugin1
>> :plugins:testPlugin1:install
>> install task for my plugin test1
>> Bonjour
>> :installPlugin
>> installed plugin testPlugin1
>>
>> BUILD SUCCESSFUL
>>
>> Total time: 3.134 secs

Reply | Threaded
Open this post in threaded view
|

Re: Plugin install process pb

Jacques Le Roux
Administrator
In reply to this post by Olivier.heintz
Thanks Olivier,

Seems it's unrelated and Mathieu is working on it :)

Jacques


Le 13/08/2018 à 17:07, Olivier Heintz a écrit :

> I'm on a debian stretch,
>
> I'm just testing with a ubuntu 18.04 and Oracle JDK and there is then same message
>
> No install task defined for plugin testPlugin1, nothing to do
>
>
>
>
> Le 13/08/2018 à 16:36, Jacques Le Roux a écrit :
>> Hi Olivier,
>>
>> Did you try with an Oracle JDK? Also which Linux distribution/version are you using?
>>
>> Jacques
>>
>>
>> Le 13/08/2018 à 16:28, Olivier Heintz a écrit :
>>> Yes, I confirm, with the old code it works
>>> ( I have found which commit after multiple test, each one for each commit on build.gradle ;-) )
>>>
>>> Le 13/08/2018 à 14:12, Taher Alkhateeb a écrit :
>>>> Hi Olivier,
>>>>
>>>> Can you confirm that if you test _before_ this commit that it works?
>>>> If yes, then this commit needs to be reverted.
>>>> On Mon, Aug 13, 2018 at 1:22 PM Olivier Heintz
>>>> <[hidden email]> wrote:
>>>>> Hi,
>>>>>
>>>>> In my environment (Linux,  openjdk version "1.8.0_171") plugin install process does not work any more since this commit (june, 20)
>>>>>
>>>>>    def taskExistsInproject(fullyQualifiedProject, taskName) {
>>>>> -    def taskExists = false
>>>>> -    subprojects.each { subProject ->
>>>>> -        if (subProject.getPath().equals(fullyQualifiedProject.toString())) {
>>>>> -            subProject.tasks.each { projTask ->
>>>>> -                if (taskName.equals(projTask.name)) {
>>>>> -                    taskExists = true
>>>>> -                }
>>>>> -            }
>>>>> -        }
>>>>> -    }
>>>>> -    return taskExists
>>>>> +    subprojects.stream()
>>>>> +        .filter { it.path == fullyQualifiedProject.toString() }
>>>>> +        .flatMap { it.tasks.stream() }
>>>>> +        .anyMatch taskName.&equals
>>>>>    }
>>>>>
>>>>>
>>>>> When I try to install the message is
>>>>>
>>>>>    ./gradlew installPlugin -PpluginId=testPlugin1
>>>>> :installPlugin
>>>>> No install task defined for plugin testPlugin1, nothing to do
>>>>>
>>>>> BUILD SUCCESSFUL
>>>>>
>>>>> Total time: 1.516 secs
>>>>>
>>>>>
>>>>> My testPlugin1 build.gradle is very simple
>>>>> task install {
>>>>>           doLast {
>>>>>                   println 'install task for my plugin test1'
>>>>>                   exec{ commandLine 'echo', 'Bonjour' } // this could be what you want
>>>>>           }
>>>>> }
>>>>>
>>>>> task uninstall {
>>>>>           doLast {
>>>>>                   println 'un-install task for my plugin test1'
>>>>>                   exec{ commandLine 'echo', 'Au-revoir' } // this could be what you want
>>>>>           }
>>>>> }
>>>>>
>>>>> task hello {
>>>>>           doLast {
>>>>>              println 'tutorialspoint'
>>>>>           }
>>>>> }
>>>>>
>>>>>
>>>>>
>>>>> with the previous version of taskExistsInproject  it works
>>>>>
>>>>> └─$ ./gradlew installPlugin -PpluginId=testPlugin1
>>>>> :plugins:testPlugin1:install
>>>>> install task for my plugin test1
>>>>> Bonjour
>>>>> :installPlugin
>>>>> installed plugin testPlugin1
>>>>>
>>>>> BUILD SUCCESSFUL
>>>>>
>>>>> Total time: 3.134 secs
>>

Reply | Threaded
Open this post in threaded view
|

Re: Plugin install process pb

Olivier.heintz
In reply to this post by Mathieu Lirzin
It works,

Thanks for your reactivity

Le 13/08/2018 à 18:25, Mathieu Lirzin a écrit :

> Hello again,
>
> Mathieu Lirzin <[hidden email]> writes:
>
>>> In my environment (Linux,  openjdk version "1.8.0_171") plugin install process does not work any more since this commit (june, 20)
>>>
>>>  def taskExistsInproject(fullyQualifiedProject, taskName) {
>>> -    def taskExists = false
>>> -    subprojects.each { subProject ->
>>> -        if (subProject.getPath().equals(fullyQualifiedProject.toString())) {
>>> -            subProject.tasks.each { projTask ->
>>> -                if (taskName.equals(projTask.name)) {
>>> -                    taskExists = true
>>> -                }
>>> -            }
>>> -        }
>>> -    }
>>> -    return taskExists
>>> +    subprojects.stream()
>>> +        .filter { it.path == fullyQualifiedProject.toString() }
>>> +        .flatMap { it.tasks.stream() }
>>> +        .anyMatch taskName.&equals
>>>  }
>
> The problem is that ‘taskName’ is compares with a task instead of the
> task ‘name’ property.  Here is a patch that fixes the bug.
>
>
>
>
> Thanks.
>
Reply | Threaded
Open this post in threaded view
|

Re: Plugin install process pb

taher
In reply to this post by Mathieu Lirzin
Hi Mathieu,

I've committed your work, thank you for the fix. For future cases, I
recommend to issue a JIRA with the fix and place your attachment over
there. Things get lost in the ML without proper tracking in a
ticketing system.
On Mon, Aug 13, 2018 at 7:25 PM Mathieu Lirzin
<[hidden email]> wrote:

>
> Hello again,
>
> Mathieu Lirzin <[hidden email]> writes:
>
> >> In my environment (Linux,  openjdk version "1.8.0_171") plugin install process does not work any more since this commit (june, 20)
> >>
> >>  def taskExistsInproject(fullyQualifiedProject, taskName) {
> >> -    def taskExists = false
> >> -    subprojects.each { subProject ->
> >> -        if (subProject.getPath().equals(fullyQualifiedProject.toString())) {
> >> -            subProject.tasks.each { projTask ->
> >> -                if (taskName.equals(projTask.name)) {
> >> -                    taskExists = true
> >> -                }
> >> -            }
> >> -        }
> >> -    }
> >> -    return taskExists
> >> +    subprojects.stream()
> >> +        .filter { it.path == fullyQualifiedProject.toString() }
> >> +        .flatMap { it.tasks.stream() }
> >> +        .anyMatch taskName.&equals
> >>  }
>
> The problem is that ‘taskName’ is compares with a task instead of the
> task ‘name’ property.  Here is a patch that fixes the bug.
>
>
> Thanks.
>
> --
> Mathieu Lirzin
> GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37
Reply | Threaded
Open this post in threaded view
|

Re: Plugin install process pb

Mathieu Lirzin
Hello Taher,

Taher Alkhateeb <[hidden email]> writes:

> I've committed your work, thank you for the fix. For future cases, I
> recommend to issue a JIRA with the fix and place your attachment over
> there. Things get lost in the ML without proper tracking in a
> ticketing system.

Sure, I will do that.

Thanks for commiting the fix.

--
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37