Skip to content

Commit

Permalink
Update imgui
Browse files Browse the repository at this point in the history
  • Loading branch information
Brov3r committed Aug 19, 2024
1 parent 26999a7 commit 22dcbcc
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 73 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = 'io.github.brov3r.imgui'
version = '1.0'
version = '1.1'

/**
* Path to the compiled Jar file
Expand Down Expand Up @@ -51,11 +51,11 @@ dependencies {
/**
* ImGui
*/
implementation "io.github.spair:imgui-java-binding:1.86.12"
implementation "io.github.spair:imgui-java-lwjgl3:1.86.12"
implementation "io.github.spair:imgui-java-natives-windows:1.86.12"
implementation "io.github.spair:imgui-java-natives-macos:1.86.12"
implementation "io.github.spair:imgui-java-natives-linux:1.86.12"
implementation "io.github.spair:imgui-java-binding:1.87.0"
implementation "io.github.spair:imgui-java-lwjgl3:1.87.0"
implementation "io.github.spair:imgui-java-natives-windows:1.87.0"
implementation "io.github.spair:imgui-java-natives-macos:1.87.0"
implementation "io.github.spair:imgui-java-natives-linux:1.87.0"

/**
* Avrix Loader
Expand All @@ -64,6 +64,7 @@ dependencies {
compileOnly files('./libs/Avrix-Core-1.5.2.jar')
}


/**
* Creating a Jar file
*/
Expand All @@ -77,4 +78,70 @@ shadowJar {
'Implementation-Version': version,
)
}
}

/**
* Building a release Jars archive with documentation and sources
*/
tasks.register('releaseBuildJar') {
dependsOn sourceJar
finalizedBy shadowJar
}

/**
* Download sources
*/
tasks.register('downloadSources') {
inputs.files configurations.runtimeClasspath
outputs.dir "${buildDir}/download"

def componentIds = configurations.runtimeClasspath.incoming.resolutionResult.allDependencies.collect { it.selected.id }

ArtifactResolutionResult result = dependencies.createArtifactResolutionQuery()
.forComponents(componentIds)
.withArtifacts(JvmLibrary, SourcesArtifact)
.execute()

def sourceArtifacts = []

result.resolvedComponents.each { ComponentArtifactsResult component ->
Set<ArtifactResult> sources = component.getArtifacts(SourcesArtifact)
println "Found ${sources.size()} sources for ${component.id}"
sources.each { ArtifactResult ar ->
if (ar instanceof ResolvedArtifactResult) {
sourceArtifacts << ar.file
}
}
}

copy {
from sourceArtifacts
into "${buildDir}/download"
}
}

/**
* Packaging source code in a Jar archive
*/
tasks.register('sourceJar', Jar) {
dependsOn downloadSources
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveBaseName.set("${rootProject.name}")
archiveClassifier.set('sources')

// Include all sources from your project
from(sourceSets.main.allSource)

// Extract contents of JAR files and include in the source JAR
def sourceJarFiles = file("${buildDir}/download").listFiles().findAll { it.name.endsWith('.jar') }

if (sourceJarFiles) {
sourceJarFiles.each { jarFile ->
from(zipTree(jarFile))
}
} else {
logger.warn "No source JAR files found in ${buildDir}/download"
}

destinationDirectory.set(file(buildPath))
}

0 comments on commit 22dcbcc

Please sign in to comment.