├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── build.gradle ├── docs └── apidocs │ └── .gitkeep ├── gradle.properties ├── gradle ├── gradle-daemon-jvm.properties └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── jitpack.yml ├── settings.gradle └── src ├── main ├── java │ └── com │ │ └── github │ │ └── tommyettinger │ │ └── your_library │ │ └── .gitkeep └── resources │ └── com │ └── github │ └── tommyettinger │ └── your_library.gwt.xml └── test ├── java └── com │ └── github │ └── tommyettinger │ └── your_library │ └── .gitkeep └── resources └── .gitkeep /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | *.bat text=auto eol=crlf 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Gradle: 2 | .gradle/ 3 | gradle-app.setting 4 | /build/ 5 | /android/build/ 6 | /core/build/ 7 | /lwjgl2/build/ 8 | /lwjgl3/build/ 9 | /html/build/ 10 | /ios/build/ 11 | /ios-moe/build/ 12 | /headless/build/ 13 | /server/build/ 14 | /shared/build/ 15 | 16 | ## Java: 17 | *.class 18 | *.war 19 | *.ear 20 | hs_err_pid* 21 | .attach_pid* 22 | 23 | ## Android: 24 | /android/libs/armeabi-v7a/ 25 | /android/libs/arm64-v8a/ 26 | /android/libs/x86/ 27 | /android/libs/x86_64/ 28 | /android/gen/ 29 | /android/out/ 30 | local.properties 31 | com_crashlytics_export_strings.xml 32 | 33 | ## Robovm: 34 | /ios/robovm-build/ 35 | 36 | ## iOS: 37 | /ios/xcode/*.xcodeproj/* 38 | !/ios/xcode/*.xcodeproj/xcshareddata 39 | !/ios/xcode/*.xcodeproj/project.pbxproj 40 | /ios/xcode/native/ 41 | /ios/IOSLauncher.app 42 | /ios/IOSLauncher.app.dSYM 43 | 44 | ## GWT: 45 | /html/war/ 46 | /html/gwt-unitCache/ 47 | .apt_generated/ 48 | /html/war/WEB-INF/deploy/ 49 | /html/war/WEB-INF/classes/ 50 | .gwt/ 51 | gwt-unitCache/ 52 | www-test/ 53 | .gwt-tmp/ 54 | 55 | ## IntelliJ, Android Studio: 56 | .idea/ 57 | *.ipr 58 | *.iws 59 | *.iml 60 | 61 | ## Eclipse: 62 | .classpath 63 | .project 64 | .metadata/ 65 | /android/bin/ 66 | /core/bin/ 67 | /lwjgl2/bin/ 68 | /lwjgl3/bin/ 69 | /html/bin/ 70 | /ios/bin/ 71 | /ios-moe/bin/ 72 | /headless/bin/ 73 | /server/bin/ 74 | /shared/bin/ 75 | *.tmp 76 | *.bak 77 | *.swp 78 | *~.nib 79 | .settings/ 80 | .loadpath 81 | .externalToolBuilders/ 82 | *.launch 83 | 84 | 85 | ## NetBeans: 86 | 87 | /nbproject/private/ 88 | /android/nbproject/private/ 89 | /core/nbproject/private/ 90 | /lwjgl2/nbproject/private/ 91 | /lwjgl3/nbproject/private/ 92 | /html/nbproject/private/ 93 | /ios/nbproject/private/ 94 | /ios-moe/nbproject/private/ 95 | /headless/nbproject/private/ 96 | /server/nbproject/private/ 97 | /shared/nbproject/private/ 98 | 99 | /nbbuild/ 100 | /android/nbbuild/ 101 | /core/nbbuild/ 102 | /lwjgl2/nbbuild/ 103 | /lwjgl3/nbbuild/ 104 | /html/nbbuild/ 105 | /ios/nbbuild/ 106 | /ios-moe/nbbuild/ 107 | /headless/nbbuild/ 108 | /server/nbbuild/ 109 | /shared/nbbuild/ 110 | 111 | /dist/ 112 | /android/dist/ 113 | /core/dist/ 114 | /lwjgl2/dist/ 115 | /lwjgl3/dist/ 116 | /html/dist/ 117 | /ios/dist/ 118 | /ios-moe/dist/ 119 | /headless/dist/ 120 | /server/dist/ 121 | /shared/dist/ 122 | 123 | /nbdist/ 124 | /android/nbdist/ 125 | /core/nbdist/ 126 | /lwjgl2/nbdist/ 127 | /lwjgl3/nbdist/ 128 | /html/nbdist/ 129 | /ios/nbdist/ 130 | /ios-moe/nbdist/ 131 | /headless/nbdist/ 132 | /server/nbdist/ 133 | /shared/nbdist/ 134 | 135 | nbactions.xml 136 | nb-configuration.xml 137 | 138 | ## jEdit garbage 139 | *~ 140 | *#*# 141 | *.*# 142 | *#*.*# 143 | /bin/ 144 | 145 | ## Windows image file caches 146 | Thumbs.db 147 | ehthumbs.db 148 | 149 | ## Folder config file 150 | Desktop.ini 151 | 152 | ## Recycle Bin used on file shares 153 | $RECYCLE.BIN/ 154 | 155 | ## Mac junk 156 | .DS_Store 157 | *.symbolMap 158 | 159 | ## output folders 160 | /out/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Library Template using libGDX and Gradle 8.x 2 | 3 | Change this to fit your library! 4 | 5 | Normally you use this repo by forking it, making any changes to match future projects you will want to make, 6 | and then using this repo as a template when you make a new project. This often involves changing the packages 7 | from `com.github.tommyettinger` to your own reverse domain name or to use your own GitHub username. 8 | 9 | You'll want to edit gradle.properties to match your library's name, description, author, license, and so on. 10 | You probably also want to edit build.gradle to match the projectName and group to what you want to use. 11 | 12 | You should "Find in Files" and search for any places that use the word "template" in order to find anything 13 | you will want to replace. The search should be case-insensitive. 14 | 15 | This includes some extra configuration so that you can deploy more easily to [JitPack](https://jitpack.io). If you're 16 | testing a specific commit and don't want to push a release to GitHub or Maven Central just to test (especially 17 | if testing by seeing if a user can build with your library), then JitPack is a great option. It can also be an 18 | excellent way of making GitHub releases available via Maven or Gradle dependencies. The `jitpack.yml` file this 19 | includes defaults to Java 21; you can potentially raise this as high as 24, though that might cause problems 20 | with Kotlin or libraries like Kryo, or as low as 11 (the minimum for the publishing plugin this uses). JDK 21 21 | may warn if you target Java 8, though this is only a warning. It has better generated JavaDocs than earlier 22 | versions, though, so using 21 seems good. 23 | 24 | Regardless of which JDK version JitPack uses to build, the default sourceCompatibility, targetCompatibility, and 25 | release are set to JDK 8, which supports many of the most convenient recent Java features, but not all. You can 26 | increase those to a higher version to get features like `var`, records, pattern matching, etc. but that typically 27 | will limit your library to being used by desktop builds (LWJGL 2 or 3, server, or headless). Using the language 28 | level of Java 8 is generally safe, but specific APIs added in Java 8 generally aren't available in RoboVM, GWT, 29 | or some versions of Android. You can go up to compatibility with 11 to get access to `var`, but then you lose 30 | all compatibility with RoboVM. 31 | 32 | The test code, which goes in `src/test/java/`, uses compatibility with Java 8 by default, so you can use LWJGL3 33 | in tests out-of-the-box. 34 | 35 | This currently uses Gradle 8.x; if you want an earlier version that uses 7.x, 36 | [here you go](https://github.com/tommyettinger/libgdx-library-template/releases/tag/v7.6)! 37 | Gradle 8.x seems to be fine for library code, and since approximately the middle of 2023, the tooling seems 38 | to have finally become capable of handling Gradle 8.x and Android/RoboVM projects. Your Android Gradle Plugin 39 | version should probably be 8.9.3 at this point; it may be able to go up soon as IDEA gets more support. 40 | 41 | Gradle 9.0.0 has been released, but I'm not going to update this for quite a while; I want full IDE support for Gradle 42 | 9.x before I start updating everything to it... I may never update, if there are too many breaking changes and too many 43 | plugins broken. -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | mavenLocal() 4 | mavenCentral() 5 | maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } 6 | gradlePluginPortal() 7 | } 8 | dependencies { 9 | classpath 'com.vanniktech:gradle-maven-publish-plugin:0.34.0' 10 | } 11 | } 12 | 13 | apply plugin: 'java-library' 14 | apply plugin: 'com.vanniktech.maven.publish' 15 | 16 | //Obviously, change the next line to match your project name. 17 | def projectName = 'libgdx-library-template' 18 | 19 | //Change this to whatever Maven Central group you might publish to, 20 | //which is probably not this one if you aren't Tommy Ettinger. 21 | group 'com.github.tommyettinger' 22 | 23 | version "$VERSION_NAME" // You can set the version in gradle.properties . 24 | 25 | import com.vanniktech.maven.publish.JavaLibrary 26 | import com.vanniktech.maven.publish.JavadocJar 27 | 28 | // This just makes sure that a Javadoc JAR and a sources JAR are produced. 29 | mavenPublishing { 30 | configure(new JavaLibrary(new JavadocJar.Javadoc(), true)) 31 | } 32 | 33 | // This sets the Javadoc JAR to have hopefully the correct name. This may need adjustment. 34 | plainJavadocJar.archiveBaseName.set(projectName) 35 | 36 | // There's pretty much no reason to use any encoding other than UTF-8 . 37 | [compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8' 38 | 39 | // Disable JDK 8's doclint 40 | // http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html 41 | if (JavaVersion.current().isJava8Compatible()) { 42 | allprojects { 43 | tasks.withType(Javadoc).tap { 44 | configureEach { 45 | // The -quiet is because of some sort of weird JDK JavaCompiler bug: 46 | // https://discuss.gradle.org/t/passing-arguments-to-compiler-and-javadoc/1661 47 | options.addStringOption('Xdoclint:none,-missing', '-quiet') 48 | } 49 | } 50 | } 51 | } 52 | 53 | compileJava { 54 | // The default Java language level this targets is 8, which is as low as current 55 | // (Java 20 and newer) JDKs will permit you to target. 56 | // You must use 8 if any libraries you use need Java 8, which now includes libGDX. 57 | sourceCompatibility = 8 58 | targetCompatibility = 8 59 | if (JavaVersion.current().isJava9Compatible()) { 60 | options.release.set(8) 61 | } 62 | } 63 | 64 | compileTestJava { 65 | // LWJGL3 needs Java 8 starting in libGDX 1.11.0, which forces tests that use LWJGL3 66 | // to use Java 8 or higher. Using options.release enforces compatibility with Java 8, 67 | // including how NIO Buffers behave (which broke compatibility in Java 9). 68 | sourceCompatibility = 8 69 | targetCompatibility = 8 70 | if (JavaVersion.current().isJava9Compatible()) { 71 | options.release.set(8) 72 | } 73 | } 74 | 75 | // JavaDocs will be published inside the docs/ folder, which you can easily put on GitHub Pages 76 | // in your repo settings. 77 | // You may instead want to remove this line if frequent doc changes use up too much repo space, 78 | // or if you use a different version control host that doesn't host HTML like this. 79 | javadoc { 80 | destinationDir = file('docs/apidocs') 81 | options { 82 | links 'https://javadoc.io/doc/com.badlogicgames.gdx/gdx/latest/' 83 | } 84 | } 85 | 86 | apply plugin: 'idea' 87 | // This makes IDEA avoid including generated JavaDocs (which are HTML files) in any search results. 88 | // If you changed where JavaDocs are published above, you should change the next line, too. 89 | idea.module.excludeDirs += [file("docs/")] 90 | 91 | jar { 92 | archiveBaseName.set(projectName) 93 | manifest { 94 | attributes 'Implementation-Title': projectName, 'Implementation-Version': archiveVersion 95 | } 96 | } 97 | 98 | repositories { 99 | // You can comment out mavenLocal() if you have problems with GWT or other sources dependencies. 100 | // A more robust solution is to keep mavenLocal() here, but delete and re-download any problematic dependencies 101 | // from inside your .m2/repository/ folder in your home directory. 102 | mavenLocal() 103 | mavenCentral() 104 | google() 105 | // Sonatype's s01 repo, and to a lesser extent its oss repo, have been very unreliable lately, and 106 | // often prevent projects from building. You probably shouldn't depend on a snapshot build in a library anyway, 107 | // because that makes the library's behavior depend on an unknown dependency version, and snapshots also tend to 108 | // be taken down after the next release is published. 109 | // maven { url 'https://s01.oss.sonatype.org' } 110 | // maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } 111 | // maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' } 112 | // JitPack is a good repo to have if you depend on commit versions. 113 | // Having the below repo might cause problems if uploading to Maven Central. 114 | // JitPack commit dependencies are much better than "-SNAPSHOT" version dependencies! 115 | maven { url 'https://jitpack.io' } 116 | } 117 | 118 | dependencies { 119 | // Change gdxVersion in gradle.properties to update or downgrade. 120 | // Libraries that don't use libGDX directly can change the next line 121 | // from `api` to `testImplementation` . 122 | // Using libGDX 1.13.1 is preferred over requiring 1.13.5 because 1.13.5 has serious issues on Android. 123 | //noinspection GDXOutdatedVersionGradleGroovy 124 | api "com.badlogicgames.gdx:gdx:$gdxVersion" 125 | // "lwjgl3" could be changed to "headless" for command-line-only testing. 126 | testImplementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion" // if you want graphical tests 127 | // testImplementation "com.badlogicgames.gdx:gdx-backend-headless:$gdxVersion" // if you want command-line tests 128 | testImplementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" 129 | testImplementation "junit:junit:4.13.2" 130 | } 131 | -------------------------------------------------------------------------------- /docs/apidocs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyettinger/libgdx-library-template/fdade12156c214e17ea6a042f7ed25817e1362a9/docs/apidocs/.gitkeep -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # The daemon process must be disabled on Gradle 8.10.1; later versions can use it or not. 2 | # We avoid using the daemon by default because it can improve startup times... sometimes. 3 | org.gradle.daemon=false 4 | # These defaults increase the default memory limits slightly, and try to make the 5 | # encoding reliably UTF-8. Getting encoding to work with just this isn't always possible. 6 | org.gradle.jvmargs=-Xms128m -Xmx512m -Dfile.encoding=UTF-8 -Dconsole.encoding=UTF-8 7 | # Configure On Demand never works if Android projects are present; it should be off. 8 | org.gradle.configureondemand=false 9 | # The logging level determines which messages get shown about how Gradle itself is working, such as if build.gradle 10 | # files are fully future-proof (which they never are, because Gradle constantly deprecates working APIs). 11 | # You can change 'quiet' below to 'lifecycle' to use Gradle's default behavior, which shows some confusing messages. 12 | # You could instead change 'quiet' below to 'info' to see info that's important mainly while debugging build files. 13 | # Documented at: https://docs.gradle.org/current/userguide/command_line_interface.html#sec:command_line_logging 14 | org.gradle.logging.level=quiet 15 | 16 | # You can downgrade this for compatibility with older libGDX versions. 17 | # The libGDX plugin from BlueBoxWare complains about libGDX 1.13.1 being outdated, but we want to avoid 1.13.5 because 18 | # it was rushed to satisfy Maven Central's unexpected publishing changes, and has serious issues on Android. 19 | # suppress inspection "GDXOutdatedVersionGradleProperties" 20 | gdxVersion=1.13.1 21 | # Other library versions are typically specified here, such as this data structure library: 22 | # jdkgdxdsVersion=1.11.0 23 | # Some libraries may only be used from tests, like this one for writing animated GIFs: 24 | # anim8Version=0.5.4 25 | 26 | # This must match your Maven Central group if you publish there; otherwise, 27 | # change this template to match your group ID. 28 | GROUP=com.github.tommyettinger 29 | # The name of the library, as it can be downloaded using Maven or Gradle. 30 | POM_ARTIFACT_ID=libgdx-library-template 31 | # This version should always be updated here; it is used elsewhere. 32 | VERSION_NAME=0.0.1-SNAPSHOT 33 | 34 | # The name of the library; might be different from POM_ARTIFACT_ID . 35 | POM_NAME=libgdx-library-template 36 | # Of course, you should change the description. 37 | POM_DESCRIPTION=Change all of this! This is only a libgdx-library-template! 38 | # This is probably not correct for a new project; 2021 is when the template 39 | # was first made. 40 | POM_INCEPTION_YEAR=2021 41 | 42 | # Just change all this to use your GitHub or other URL. 43 | POM_URL=https://github.com/tommyettinger/libgdx-library-template/ 44 | POM_SCM_URL=https://github.com/tommyettinger/libgdx-library-template/ 45 | POM_SCM_CONNECTION=scm:https://tommyettinger@github.com/tommyettinger/libgdx-library-template.git 46 | POM_SCM_DEV_CONNECTION=scm:git://github.com/tommyettinger/libgdx-library-template.git 47 | 48 | # This applies to the template itself; it does not apply to your library unless 49 | # you choose it as the license for your library. Using CC0 means all code in your 50 | # library was written by you/your team, or was already public-domain. 51 | POM_LICENCE_NAME=Creative Commons Zero 52 | POM_LICENCE_URL=https://creativecommons.org/publicdomain/zero/1.0/ 53 | POM_LICENCE_DIST=repo 54 | 55 | # Another common option is the Apache License, which libGDX uses. It is considered 56 | # a "business-friendly" permissive license, and allows commercial use. 57 | ## POM_LICENCE_NAME=The Apache Software License, Version 2.0 58 | ## POM_LICENCE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt 59 | ## POM_LICENCE_DIST=repo 60 | 61 | # Another option is the MIT License, which is very permissive. It also allows 62 | # commercial use, and only requires any license headers to stay intact. 63 | ## POM_LICENCE_NAME=MIT License 64 | ## POM_LICENCE_URL=https://opensource.org/licenses/mit-license.php 65 | ## POM_LICENCE_DIST=repo 66 | 67 | # Another option is the Eclipse Public License. It is very similar to the Apache 68 | # License; it is also "business-friendly," permissive, and allows commercial use. 69 | ## POM_LICENCE_NAME=Eclipse Public License v 1.0 70 | ## POM_LICENCE_URL=http://www.eclipse.org/legal/epl-v10.html 71 | ## POM_LICENCE_DIST=repo 72 | 73 | # I can't stop you from licensing your code as GPL, but I won't use it if you do. 74 | # The GPL isn't compatible with most other licenses, and restricts code that uses 75 | # a GPL library to also be GPL. The LGPL was created in an attempt to solve this 76 | # library issue; still, it isn't preferable to Apache, EPL, MIT, or BSD in regard 77 | # to license compatibility with existing Java libraries. Some purposes are a 78 | # great fit for GPL, especially many core parts of Linux, and you may be required 79 | # to use GPL because a library you need is GPL-licensed, but the GPL appears only 80 | # rarely across most of the open-source Java ecosystem. OpenJDK, however, is 81 | # licensed under the "GPL v2 with Classpath Exception," so there's that. 82 | 83 | # Obviously, change this part of the template if you aren't Tommy Ettinger. 84 | POM_DEVELOPER_ID=tommyettinger 85 | POM_DEVELOPER_NAME=Tommy Ettinger 86 | POM_DEVELOPER_URL=https://github.com/tommyettinger/ 87 | 88 | # These two lines allow uploading to Maven Central, if you want. 89 | # You can use JitPack to handle releases and never touch Maven Central, or you can 90 | # register with Sonatype to get a Maven Central "group" that you can push to. 91 | # Maven Central can be a lot more work, but is the more "professional" and stable 92 | # of the two options. Using DEFAULT will be discontinued after June 2025, and you 93 | # must go through a migration (with a different token) on Maven Central's site to 94 | # use CENTRAL_PORTAL instead, which is much faster to release with. 95 | SONATYPE_HOST=CENTRAL_PORTAL 96 | # If releasing to Maven Central, you should set this to true during the release 97 | # process, and typically you will want to set it back to false before you tag 98 | # a release on GitHub. This is because Maven Central needs signed JARs, but 99 | # JitPack can't easily sign JARs using your keys, if it just built those JARs. 100 | # If true, this needs GPG signing enabled; doing that has a learning curve... 101 | RELEASE_SIGNING_ENABLED=false 102 | -------------------------------------------------------------------------------- /gradle/gradle-daemon-jvm.properties: -------------------------------------------------------------------------------- 1 | #This file is generated by updateDaemonJvm 2 | toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/65aaef917b9f394804f058f1861225c9/redirect 3 | toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/c728c5388b044fbdbbc44b0c6acee0df/redirect 4 | toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/65aaef917b9f394804f058f1861225c9/redirect 5 | toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/c728c5388b044fbdbbc44b0c6acee0df/redirect 6 | toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/dc463b4a8183dbcaa1b32544189c7f03/redirect 7 | toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/cb7dc109dd590ebca2d703734d23c9d3/redirect 8 | toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/65aaef917b9f394804f058f1861225c9/redirect 9 | toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/c728c5388b044fbdbbc44b0c6acee0df/redirect 10 | toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/43ee83889b87bacad5d3071ae7bbd349/redirect 11 | toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/2d57bdd1e17a18f83ff073919daa35ba/redirect 12 | toolchainVersion=17 13 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyettinger/libgdx-library-template/fdade12156c214e17ea6a042f7ed25817e1362a9/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # SPDX-License-Identifier: Apache-2.0 19 | # 20 | 21 | ############################################################################## 22 | # 23 | # Gradle start up script for POSIX generated by Gradle. 24 | # 25 | # Important for running: 26 | # 27 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 28 | # noncompliant, but you have some other compliant shell such as ksh or 29 | # bash, then to run this script, type that shell name before the whole 30 | # command line, like: 31 | # 32 | # ksh Gradle 33 | # 34 | # Busybox and similar reduced shells will NOT work, because this script 35 | # requires all of these POSIX shell features: 36 | # * functions; 37 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 38 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 39 | # * compound commands having a testable exit status, especially «case»; 40 | # * various built-in commands including «command», «set», and «ulimit». 41 | # 42 | # Important for patching: 43 | # 44 | # (2) This script targets any POSIX shell, so it avoids extensions provided 45 | # by Bash, Ksh, etc; in particular arrays are avoided. 46 | # 47 | # The "traditional" practice of packing multiple parameters into a 48 | # space-separated string is a well documented source of bugs and security 49 | # problems, so this is (mostly) avoided, by progressively accumulating 50 | # options in "$@", and eventually passing that to Java. 51 | # 52 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 53 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 54 | # see the in-line comments for details. 55 | # 56 | # There are tweaks for specific operating systems such as AIX, CygWin, 57 | # Darwin, MinGW, and NonStop. 58 | # 59 | # (3) This script is generated from the Groovy template 60 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 61 | # within the Gradle project. 62 | # 63 | # You can find Gradle at https://github.com/gradle/gradle/. 64 | # 65 | ############################################################################## 66 | 67 | # Attempt to set APP_HOME 68 | 69 | # Resolve links: $0 may be a link 70 | app_path=$0 71 | 72 | # Need this for daisy-chained symlinks. 73 | while 74 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 75 | [ -h "$app_path" ] 76 | do 77 | ls=$( ls -ld "$app_path" ) 78 | link=${ls#*' -> '} 79 | case $link in #( 80 | /*) app_path=$link ;; #( 81 | *) app_path=$APP_HOME$link ;; 82 | esac 83 | done 84 | 85 | # This is normally unused 86 | # shellcheck disable=SC2034 87 | APP_BASE_NAME=${0##*/} 88 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 89 | APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH="\\\"\\\"" 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | if ! command -v java >/dev/null 2>&1 137 | then 138 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 139 | 140 | Please set the JAVA_HOME variable in your environment to match the 141 | location of your Java installation." 142 | fi 143 | fi 144 | 145 | # Increase the maximum file descriptors if we can. 146 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 147 | case $MAX_FD in #( 148 | max*) 149 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 150 | # shellcheck disable=SC2039,SC3045 151 | MAX_FD=$( ulimit -H -n ) || 152 | warn "Could not query maximum file descriptor limit" 153 | esac 154 | case $MAX_FD in #( 155 | '' | soft) :;; #( 156 | *) 157 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 158 | # shellcheck disable=SC2039,SC3045 159 | ulimit -n "$MAX_FD" || 160 | warn "Could not set maximum file descriptor limit to $MAX_FD" 161 | esac 162 | fi 163 | 164 | # Collect all arguments for the java command, stacking in reverse order: 165 | # * args from the command line 166 | # * the main class name 167 | # * -classpath 168 | # * -D...appname settings 169 | # * --module-path (only if needed) 170 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 171 | 172 | # For Cygwin or MSYS, switch paths to Windows format before running java 173 | if "$cygwin" || "$msys" ; then 174 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 175 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 176 | 177 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 178 | 179 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 180 | for arg do 181 | if 182 | case $arg in #( 183 | -*) false ;; # don't mess with options #( 184 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 185 | [ -e "$t" ] ;; #( 186 | *) false ;; 187 | esac 188 | then 189 | arg=$( cygpath --path --ignore --mixed "$arg" ) 190 | fi 191 | # Roll the args list around exactly as many times as the number of 192 | # args, so each arg winds up back in the position where it started, but 193 | # possibly modified. 194 | # 195 | # NB: a `for` loop captures its iteration list before it begins, so 196 | # changing the positional parameters here affects neither the number of 197 | # iterations, nor the values presented in `arg`. 198 | shift # remove old arg 199 | set -- "$@" "$arg" # push replacement arg 200 | done 201 | fi 202 | 203 | 204 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 205 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 206 | 207 | # Collect all arguments for the java command: 208 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 209 | # and any embedded shellness will be escaped. 210 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 211 | # treated as '${Hostname}' itself on the command line. 212 | 213 | set -- \ 214 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 215 | -classpath "$CLASSPATH" \ 216 | -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ 217 | "$@" 218 | 219 | # Stop when "xargs" is not available. 220 | if ! command -v xargs >/dev/null 2>&1 221 | then 222 | die "xargs is not available" 223 | fi 224 | 225 | # Use "xargs" to parse quoted args. 226 | # 227 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 228 | # 229 | # In Bash we could simply go: 230 | # 231 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 232 | # set -- "${ARGS[@]}" "$@" 233 | # 234 | # but POSIX shell has neither arrays nor command substitution, so instead we 235 | # post-process each arg (as a line of input to sed) to backslash-escape any 236 | # character that might be a shell metacharacter, then use eval to reverse 237 | # that process (while maintaining the separation between arguments), and wrap 238 | # the whole thing up as a single "set" statement. 239 | # 240 | # This will of course break if any of these variables contains a newline or 241 | # an unmatched quote. 242 | # 243 | 244 | eval "set -- $( 245 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 246 | xargs -n1 | 247 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 248 | tr '\n' ' ' 249 | )" '"$@"' 250 | 251 | exec "$JAVACMD" "$@" 252 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | @rem SPDX-License-Identifier: Apache-2.0 17 | @rem 18 | 19 | @if "%DEBUG%"=="" @echo off 20 | @rem ########################################################################## 21 | @rem 22 | @rem Gradle startup script for Windows 23 | @rem 24 | @rem ########################################################################## 25 | 26 | @rem Set local scope for the variables with windows NT shell 27 | if "%OS%"=="Windows_NT" setlocal 28 | 29 | set DIRNAME=%~dp0 30 | if "%DIRNAME%"=="" set DIRNAME=. 31 | @rem This is normally unused 32 | set APP_BASE_NAME=%~n0 33 | set APP_HOME=%DIRNAME% 34 | 35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 37 | 38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 40 | 41 | @rem Find java.exe 42 | if defined JAVA_HOME goto findJavaFromJavaHome 43 | 44 | set JAVA_EXE=java.exe 45 | %JAVA_EXE% -version >NUL 2>&1 46 | if %ERRORLEVEL% equ 0 goto execute 47 | 48 | echo. 1>&2 49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 50 | echo. 1>&2 51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 52 | echo location of your Java installation. 1>&2 53 | 54 | goto fail 55 | 56 | :findJavaFromJavaHome 57 | set JAVA_HOME=%JAVA_HOME:"=% 58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 59 | 60 | if exist "%JAVA_EXE%" goto execute 61 | 62 | echo. 1>&2 63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 64 | echo. 1>&2 65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 66 | echo location of your Java installation. 1>&2 67 | 68 | goto fail 69 | 70 | :execute 71 | @rem Setup the command line 72 | 73 | set CLASSPATH= 74 | 75 | 76 | @rem Execute Gradle 77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* 78 | 79 | :end 80 | @rem End local scope for the variables with windows NT shell 81 | if %ERRORLEVEL% equ 0 goto mainEnd 82 | 83 | :fail 84 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 85 | rem the _cmd.exe /c_ return code! 86 | set EXIT_CODE=%ERRORLEVEL% 87 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 88 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 89 | exit /b %EXIT_CODE% 90 | 91 | :mainEnd 92 | if "%OS%"=="Windows_NT" endlocal 93 | 94 | :omega 95 | -------------------------------------------------------------------------------- /jitpack.yml: -------------------------------------------------------------------------------- 1 | before_install: 2 | - sdk install java 21-open 3 | - sdk use java 21-open 4 | jdk: 5 | - openjdk21 6 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | // Applies the foojay-resolver plugin to allow automatic download of JDKs. 3 | id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0" 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/com/github/tommyettinger/your_library/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyettinger/libgdx-library-template/fdade12156c214e17ea6a042f7ed25817e1362a9/src/main/java/com/github/tommyettinger/your_library/.gitkeep -------------------------------------------------------------------------------- /src/main/resources/com/github/tommyettinger/your_library.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 23 | 24 | 26 | 27 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/test/java/com/github/tommyettinger/your_library/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyettinger/libgdx-library-template/fdade12156c214e17ea6a042f7ed25817e1362a9/src/test/java/com/github/tommyettinger/your_library/.gitkeep -------------------------------------------------------------------------------- /src/test/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyettinger/libgdx-library-template/fdade12156c214e17ea6a042f7ed25817e1362a9/src/test/resources/.gitkeep --------------------------------------------------------------------------------