Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* fixed: gradle plugin failed to be deployed #780

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

dkimitsa
Copy link
Contributor

it discovered a set of issue:

Issue 1. plugin wasn't deployed in several last builds from master branch.

 Execution failed for task ':validatePlugins'.
  > Plugin validation failed with 1 problem:
      - Error: Type 'org.robovm.gradle.tasks.AbstractSimulatorTask' method 'getDeviceType()' should not be annotated with: @Internal.

fix: annotation was removed (method doesn't look as pure getter) and validatePlugins option was added to build invocation

Issue 2. its discovered that after #766 applied build failed with:

* What went wrong:
A problem occurred configuring project ':facebook-share-kit'.
> Could not create task ':facebook-share-kit:launchIPhoneSimulator'.
   > Could not create task of type 'IPhoneSimulatorTask'.
      > Could not generate a decorated class for type IPhoneSimulatorTask.
         > org/robovm/compiler/log/Logger
Caused by: java.lang.NoClassDefFoundError: org/robovm/compiler/log/Logger

root case of it: robovm-compiler dependency was excluded from shadowJar (thats a bug). But it was working as previously pom.xml contained runtime dependency to robovm-compiler (that's another bug as we produce shadowJar with merged dependencies)

Issue 3: pom.xml for gradle plugin is empty

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <!-- This module was also published with a richer model, Gradle metadata,  -->
  <!-- which should be used instead. Do not delete the following line which  -->
  <!-- is to indicate to Gradle or any Gradle module metadata file consumer  -->
  <!-- that they should prefer consuming it instead. -->
  <!-- do_not_remove: published-with-gradle-metadata -->
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mobidevelop.robovm</groupId>
  <artifactId>robovm-gradle-plugin</artifactId>
  <version>2.3.22-SNAPSHOT</version>
</project>

it happens as plugin-publish uses pluginMaven publication but we set metadata for mavenJava, due another bug both pluginMaven and mavenJava are being deployed and pluginMaven overrides first (thats another issues)

Issue 4: two artifacts are being deployed under same id: pluginMaven and mavenJava

it can be observer as following warning:

Multiple publications with coordinates 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.22-SNAPSHOT' are published to repository 'mavenLocal'. The publications 'mavenJava' in root project 'robovm-gradle-plugin' and 'pluginMaven' in root project 'robovm-gradle-plugin' will overwrite each other!

Fixes:

  1. To have single prorely configured artifact mavenJava to be removed and pluginMaven used as described in plugin-publish docs;
  2. Caused by: java.lang.NoClassDefFoundError: org/robovm/compiler/log/Logger is fixed by removing 'exclude(dependency' -- compiler has to be packed into shadowJar

it discovered a set of issue:

## Issue 1. plugin wasn't deployed in several last builds from master branch.
```
 Execution failed for task ':validatePlugins'.
  > Plugin validation failed with 1 problem:
      - Error: Type 'org.robovm.gradle.tasks.AbstractSimulatorTask' method 'getDeviceType()' should not be annotated with: @internal.
```
fix: annotation was removed (method doesn't look as pure getter) and `validatePlugins` option was added to build invocation

## Issue 2. its discovered that after MobiVM#766 applied build failed with:
```
* What went wrong:
A problem occurred configuring project ':facebook-share-kit'.
> Could not create task ':facebook-share-kit:launchIPhoneSimulator'.
   > Could not create task of type 'IPhoneSimulatorTask'.
      > Could not generate a decorated class for type IPhoneSimulatorTask.
         > org/robovm/compiler/log/Logger
Caused by: java.lang.NoClassDefFoundError: org/robovm/compiler/log/Logger
```
root case of it: `robovm-compiler` dependency was excluded from shadowJar (thats a bug).
But it was working as previously pom.xml contained runtime dependency to `robovm-compiler` (that's another bug as we produce shadowJar with merged dependencies)

## Issue 3: pom.xml for gradle plugin is empty
```
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <!-- This module was also published with a richer model, Gradle metadata,  -->
  <!-- which should be used instead. Do not delete the following line which  -->
  <!-- is to indicate to Gradle or any Gradle module metadata file consumer  -->
  <!-- that they should prefer consuming it instead. -->
  <!-- do_not_remove: published-with-gradle-metadata -->
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mobidevelop.robovm</groupId>
  <artifactId>robovm-gradle-plugin</artifactId>
  <version>2.3.22-SNAPSHOT</version>
</project>
```
it happens as `plugin-publish` uses `pluginMaven` publication but we set metadata for `mavenJava`, due another bug both `pluginMaven` and `mavenJava` are being deployed and `pluginMaven` overrides first  (thats another issues)

## Issue 4: two artifacts are being deployed under same id:   `pluginMaven` and `mavenJava`
it can be observer as following warning:
> Multiple publications with coordinates 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.22-SNAPSHOT' are published to repository 'mavenLocal'. The publications 'mavenJava' in root project 'robovm-gradle-plugin' and 'pluginMaven' in root project 'robovm-gradle-plugin' will overwrite each other!

Fixes:
1. To have single prorely configured artifact `mavenJava` to be removed and `pluginMaven` used as described in `plugin-publish` docs;
2. `Caused by: java.lang.NoClassDefFoundError: org/robovm/compiler/log/Logger` is fixed by removing 'exclude(dependency' -- compiler has to be packed into shadowJar
@Tom-Ski Tom-Ski merged commit 10889cb into MobiVM:master Apr 15, 2024
1 check passed
@dkimitsa dkimitsa deleted the fix/gradle-plugin-broken branch April 15, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants