Skip to content

Commit

Permalink
Another fix for jar building in JitPack
Browse files Browse the repository at this point in the history
  • Loading branch information
cech12 committed Jan 2, 2024
1 parent 38aec2c commit b602b44
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 72 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Forge Recommended Versioning](https://mcforge.readthedocs.io/en/latest/conventions/versioning/).

## [1.20.2-3.0.0.3] - 2024-01-02
### Changed
- Another fix for jar building in JitPack

## [1.20.2-3.0.0.2] - 2024-01-02
### Changed
- fixed building jars in JitPack
Expand Down
24 changes: 24 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {

subprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'

java.toolchain.languageVersion = JavaLanguageVersion.of(17)
java.withSourcesJar()
Expand Down Expand Up @@ -92,4 +93,27 @@ subprojects {
tasks.withType(GenerateModuleMetadata).configureEach {
enabled = false
}

publishing {
publications {
maven(MavenPublication) {
groupId project.group
artifactId project.name
version "$project.minecraft_version-$project.version"
from components.java

// Filter any dependencies from appearing in the pom.xml
pom.withXml {
asNode().dependencies.dependency.each { dep ->
assert dep.parent().remove(dep)
}
}
}
}
repositories {
maven {
url "file://" + System.getenv("local_maven")
}
}
}
}
15 changes: 0 additions & 15 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id 'idea'
id 'java'
id 'maven-publish'
id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT'
}
base {
Expand All @@ -17,18 +16,4 @@ minecraft {
dependencies {
compileOnly group:'org.spongepowered', name:'mixin', version:'0.8.5'
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2'
}

publishing {
publications {
mavenJava(MavenPublication) {
artifactId base.archivesName.get()
from components.java
}
}
repositories {
maven {
url "file://" + System.getenv("local_maven")
}
}
}
28 changes: 0 additions & 28 deletions forge/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id 'idea'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '[6.0.16,6.2)'
id 'org.spongepowered.mixin' version '0.7-SNAPSHOT'
}
Expand Down Expand Up @@ -93,30 +92,3 @@ artifacts {
}

jar.finalizedBy('reobfJar')

publishing {
publications {
register('mavenJava', MavenPublication) {
artifact jar
artifact apiJar
artifact javadocJar
artifact sourcesJar

groupId = project.group
artifactId project.archivesBaseName
version project.version

// Filter any dependencies from appearing in the pom.xml
pom.withXml {
asNode().dependencies.dependency.each { dep ->
assert dep.parent().remove(dep)
}
}
}
}
repositories {
maven {
url "file://" + System.getenv("local_maven")
}
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Every field you add must be added to the root build.gradle expandProps map.

# Project
version=3.0.0.2
version=3.0.0.3
group=de.cech12.bucketlib
mod_id=bucketlib
mod_name=BucketLib
Expand Down
28 changes: 0 additions & 28 deletions neoforge/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.41'
id 'java-library'
}
Expand Down Expand Up @@ -68,31 +67,4 @@ tasks.withType(ProcessResources).matching(notNeoTask).configureEach {

artifacts {
archives apiJar
}

publishing {
publications {
register('mavenJava', MavenPublication) {
artifact jar
artifact apiJar
artifact javadocJar
artifact sourcesJar

groupId = project.group
artifactId project.archivesBaseName
version project.version

// Filter any dependencies from appearing in the pom.xml
pom.withXml {
asNode().dependencies.dependency.each { dep ->
assert dep.parent().remove(dep)
}
}
}
}
repositories {
maven {
url "file://" + System.getenv("local_maven")
}
}
}

0 comments on commit b602b44

Please sign in to comment.