Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.eowise:gradle-packer-plugin:'
}
dependencies {
implementation("com.github.eowise:gradle-packer-plugin:")
}
<dependency>
<groupId>com.github.eowise</groupId>
<artifactId>gradle-packer-plugin</artifactId>
<version></version>
</dependency>
libraryDependencies += "com.github.eowise" % "gradle-packer-plugin" % ""
:dependencies [[com.github.eowise/gradle-packer-plugin ""]]
A Gradle plugin witch automatically packs texture for a libgdx game, using libgdx texture packer. Before packing, the plugin can do some actions on the resources provided, such as :
buildscript {
repositories {
jCenter()
}
dependencies {
classpath 'com.eowise:packer:0.7.3'
}
}
apply plugin: 'packer'
A very basic scenario :
task packs(type: com.eowise.packer.Packer) {
resourcesInputPath 'path/to/resources'
atlasesOutputPath 'path/to/atlases'
}
This task will do the folowing actions :
You may want to add several resolutions :
task packs(type: com.eowise.packer.Packer) {
resourcesInputPath 'path/to/resources'
atlasesOutputPath 'path/to/packs'
resolutions {
add resolution(name: 'xhdpi')
add resolution(name: 'hdpi', ratio: 0.75)
add resolution(name: 'mdpi', ratio: 0.5)
add resolution(name: 'ldpi', ratio: 0.375)
}
}
All imput iamges will be resized according given ratio.
You can also pack several atlases :
task packs(type: com.eowise.packer.Packer) {
resourcesInputPath 'path/to/resources'
atlasesOutputPath 'path/to/packs'
atlases {
add atlas(name: 'MainMenu')
add atlas(name: 'Game')
add atlas(name: 'Options')
}
}