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

Support publishing Gradle plugin marker artifact #766

Merged
merged 3 commits into from
Feb 28, 2024

Conversation

Goooler
Copy link
Contributor

@Goooler Goooler commented Jan 3, 2024

plugins/gradle/build.gradle Outdated Show resolved Hide resolved
@Goooler Goooler changed the title Support publishing Gradle plugin marker artifacts Support publishing Gradle plugin marker artifact Jan 3, 2024
@Tom-Ski Tom-Ski merged commit 040baf7 into MobiVM:master Feb 28, 2024
@Goooler Goooler deleted the plugin-marker branch February 28, 2024 14:58
dkimitsa added a commit to dkimitsa/robovm that referenced this pull request Apr 15, 2024
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
dkimitsa pushed a commit to dkimitsa/robovm that referenced this pull request Apr 15, 2024
* Configure publishing plugin

https://plugins.gradle.org/docs/publish-plugin

* Compat old users

* Fix legacy namespace

(cherry picked from commit 040baf7)
dkimitsa added a commit to dkimitsa/robovm that referenced this pull request Apr 15, 2024
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 pushed a commit that referenced this pull request Apr 15, 2024
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
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.

3 participants