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

Adds a variants from configuration #137

Conversation

yannicklamprecht
Copy link

When maven publish plugin is present on userdev projects
a normal publish results into a wrong module file in maven repository.

This commit adds the missing reobfuscated jars to this module file.

The initial issue is that depending on the reobfuscated plugin dependency results into loading the dev dependency because no reobfuscated one is defined in the module file.

Example:
before that change: https://eldonexus.de/repository/maven-releases/com/github/yannicklamprecht/worldborderapi/1.181.1/worldborderapi-1.181.1.module
after that change: https://eldonexus.de/repository/maven-releases/com/github/yannicklamprecht/worldborderapi/1.181.2/worldborderapi-1.181.2.module

The diffs are the missing files in the two variants: apiElements and runtimeElements

@yannicklamprecht yannicklamprecht force-pushed the task/add-reobfjar-to-variants-config-when-publish-to-maven-local-task-is-present branch from b8a22bc to d930876 Compare February 15, 2022 23:32
When maven publish plugin is present on userdev projects
a normal publish results into a wrong module file in maven repository.

This commit adds the missing reobfuscated jars to this module file.
@yannicklamprecht yannicklamprecht force-pushed the task/add-reobfjar-to-variants-config-when-publish-to-maven-local-task-is-present branch from d930876 to 0e576c9 Compare February 15, 2022 23:33
electronicboy
electronicboy previously approved these changes Mar 9, 2022
@jpenilla
Copy link
Member

jpenilla commented Jan 31, 2023

This isn't the correct approach, for now, you can use this to publish the reobf jar under its own classifier (which dependants would need to specify):

publishing {
	publications {
		register<MavenPublication>("maven") {
			from(components["java"])
			artifact(tasks.reobfJar) {
				classifier = "reobf"
			}
		}
	}
}

If you want reobf to be selected automatically you would need to remove the java components line, due to how Gradle selects variants. After #177, something better can be worked on for publishing.

@jpenilla jpenilla closed this Jan 31, 2023
@yannicklamprecht yannicklamprecht deleted the task/add-reobfjar-to-variants-config-when-publish-to-maven-local-task-is-present branch January 31, 2023 20:06
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