Skip to content

Commit

Permalink
#64 migrate to gradle-7.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsx-dev committed Jul 25, 2022
1 parent b391fc3 commit 2c31fd5
Show file tree
Hide file tree
Showing 15 changed files with 386 additions and 304 deletions.
48 changes: 28 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
buildscript {
repositories {
mavenCentral()
maven { url 'https://s01.oss.sonatype.org' }
mavenLocal()
google()
gradlePluginPortal()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
}
dependencies {
classpath "org.wisepersist:gwt-gradle-plugin:$gwtPluginVersion"
}
}
allprojects {

group = 'com.github.mgsx-dev.gdx-gltf'
Expand All @@ -6,34 +20,28 @@ allprojects {
apply plugin: "eclipse"
apply plugin: "idea"
}

configure(subprojects) {
apply plugin: 'java-library'
compileJava {
options.incremental = true
}
}
subprojects {
ext {
gdxVersion = '1.9.11'
junitVersion = '4.12'
}

buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
jcenter()
}
}

repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
jcenter()
}

apply plugin: "java"
apply plugin: 'maven-publish'

repositories {
mavenCentral()
maven { url 'https://s01.oss.sonatype.org' }
mavenLocal()
gradlePluginPortal()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
}
}

eclipse.project.name = "gltf-root"
10 changes: 5 additions & 5 deletions demo/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ apply plugin: "java"

dependencies {

compile project(":gltf")
api project(":gltf")

compile "com.badlogicgames.gdx:gdx:$gdxVersion"
api "com.badlogicgames.gdx:gdx:$gdxVersion"

testCompile "junit:junit:$junitVersion"
testCompile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
testCompile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
testImplementation "junit:junit:$junitVersion"
testImplementation "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
testImplementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
}

sourceCompatibility = 1.6
Expand Down
4 changes: 2 additions & 2 deletions demo/core/src/GLTFDemo.gwt.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://google-web-toolkit.googlecode.com/svn/trunk/distro-source/core/src/gwt-module.dtd">
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.8.2//EN" "http://www.gwtproject.org/doctype/2.8.2/gwt-module.dtd">
<module>
<inherits name='GLTF' />
<source path="net/mgsx/gltf/demo" />
Expand All @@ -10,5 +10,5 @@
<extend-configuration-property name="gdx.files.classpath" value="net/mgsx/gltf/demo/shaders/gltf-ceil-shading.fs.glsl" />
<extend-configuration-property name="gdx.files.classpath" value="net/mgsx/gltf/demo/shaders/outline.vs.glsl" />
<extend-configuration-property name="gdx.files.classpath" value="net/mgsx/gltf/demo/shaders/outline.fs.glsl" />

</module>
74 changes: 25 additions & 49 deletions demo/desktop/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apply plugin: "java"
apply plugin: 'application'

dependencies {
compile project(":demo:core")
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
api project(":demo:core")
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
}

sourceCompatibility = 1.6
Expand All @@ -13,63 +13,39 @@ sourceSets.test.java.srcDirs = [ "test/" ]
project.ext.mainClassName = "net.mgsx.gltf.demo.DesktopLauncher"
project.ext.assetsDir = new File("../android/assets");

task run(dependsOn: classes, type: JavaExec) {
main = project.mainClassName
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
workingDir = project.assetsDir
ignoreExitValue = true
run {
workingDir = '../android/assets'
setIgnoreExitValue(true)
}

task debug(dependsOn: classes, type: JavaExec) {
main = project.mainClassName
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
workingDir = project.assetsDir
ignoreExitValue = true
debug = true
jar {
archiveBaseName.set("$appName-desktop")
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
dependsOn configurations.runtimeClasspath
from '../android/assets'
exclude 'models'
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA')
dependencies {
exclude('META-INF/INDEX.LIST', 'META-INF/maven/**')
}
manifest {
attributes 'Main-Class': project.mainClassName
}
doLast {
file(archiveFile).setExecutable(true, false)
}
}

task distDesktop(type: Jar, dependsOn: [classes]) {
from files(sourceSets.main.output.classesDir)
from files(sourceSets.main.output.resourcesDir)
from {configurations.compile.collect {zipTree(it)}}
from files(project.assetsDir)

exclude("models")

// additional files could be added like this :
// from file("$projectDir/LICENSE");

// final JAR basename could be modified like this (default is project name) :
baseName = "$appName-desktop"

manifest {
attributes 'Main-Class': project.mainClassName
}
doLast {
file(archivePath).setExecutable(true, false)
}
task distDesktop(dependsOn: [jar]) {
}

eclipse {
project {
name = appName + "-desktop"
linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/android/assets'
}
}

task afterEclipseImport(description: "Post processing after project generation", group: "IDE") {
doLast {
def classpath = new XmlParser().parse(file(".classpath"))
new Node(classpath, "classpathentry", [ kind: 'src', path: 'assets' ]);
def writer = new FileWriter(file(".classpath"))
def printer = new XmlNodePrinter(new PrintWriter(writer))
printer.setPreserveWhitespace(true)
printer.print(classpath)
}
}

publishing {
publications {
maven(MavenPublication) {
Expand Down
105 changes: 69 additions & 36 deletions demo/html/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
classpath "org.gretty:gretty:3.0.7"
}
}
apply plugin: "gwt"
apply plugin: "war"
apply plugin: "java"
apply plugin: "jetty"
apply plugin: "org.gretty"

dependencies {
compile project(":demo:core")
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
implementation project(":demo:core")
implementation "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
implementation "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
implementation "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"

}

gwt {
gwtVersion='2.8.2' // Should match the gwt version used for building the gwt backend
gwtVersion="$gwtFrameworkVersion" // Should match the gwt version used for building the gwt backend
maxHeapSize="1G" // Default 256m is not enough for gwt compiler. GWT is HUNGRY
minHeapSize="1G"

Expand All @@ -32,36 +34,68 @@ gwt {
}
}

task draftRun(type: JettyRunWar) {
dependsOn draftWar
dependsOn.remove('war')
webApp=draftWar.archivePath
daemon=true

import org.akhikhl.gretty.AppBeforeIntegrationTestTask
import org.wisepersist.gradle.plugins.gwt.GwtSuperDev

gretty.httpPort = 8080
gretty.resourceBase = project.buildDir.path + "/gwt/draftOut"
gretty.contextPath = "/"
gretty.portPropertiesFileName = "TEMP_PORTS.properties"

task startHttpServer (dependsOn: [draftCompileGwt]) {
doFirst {
copy {
from "webapp"
into gretty.resourceBase
}
copy {
from "war"
into gretty.resourceBase
}
}
}
task beforeRun(type: AppBeforeIntegrationTestTask, dependsOn: startHttpServer) {
// The next line allows ports to be reused instead of
// needing a process to be manually terminated.
file("build/TEMP_PORTS.properties").delete()
// Somewhat of a hack; uses Gretty's support for wrapping a task in
// a start and then stop of a Jetty server that serves files while
// also running the SuperDev code server.
integrationTestTask 'superDev'

interactive false
}

task superDev(type: de.richsource.gradle.plugins.gwt.GwtSuperDev) {
dependsOn draftRun
task superDev(type: GwtSuperDev) {
doFirst {
gwt.modules = gwt.devModules
gwt.modules = gwt.devModules
}
}
// This next line can be changed if you want to, for instance, always build into the
// docs/ folder of a Git repo, which can be set to automatically publish on GitHub Pages.
// This is relative to the html/ folder.
var outputPath = "build/dist/"

task distWeb(dependsOn: [clean, compileGwt]) {
doLast {
file("build/dist").mkdirs()
file(outputPath).mkdirs()
copy {
from "build/gwt/out"
into "build/dist"
exclude 'WEB-INF', 'html/clear.cache.gif', 'html/html.devmode.js'
from("build/gwt/out"){
exclude '**/*.symbolMap' // Not used by a dist, and these can be large.
exclude 'WEB-INF', 'html/clear.cache.gif', 'html/html.devmode.js'
}
into outputPath
}
copy {
from "webapp"
into "build/dist"
exclude 'WEB-INF'
}
from("webapp") {
exclude 'WEB-INF'
}
into outputPath
}
copy {
from "war"
into "build/dist"
into outputPath
exclude 'WEB-INF'
}
}
Expand All @@ -71,23 +105,22 @@ task validateDistWeb(type: Exec /*, dependsOn: distWeb*/) {
commandLine 'ruby', '-e', "require 'sinatra' ; set public_folder: '$buildDir/dist' ; set bind: '0.0.0.0'"
}

task distWebZip(type: Zip, /*, dependsOn: distWeb*/){
from 'build/dist/'
archiveName "dist-${version}.zip"
destinationDir(file("build"))
}

draftWar {
from "war"
task distWebZip(type: Zip, dependsOn: distWeb){
from(outputPath)
archiveBaseName.set("dist-${version}.zip")
destinationDir(file("build"))
}

task addSource << {
sourceSets.main.compileClasspath += files(project(':gltf').sourceSets.main.allJava.srcDirs)
sourceSets.main.compileClasspath += files(project(':demo:core').sourceSets.main.allJava.srcDirs)
task addSource {
doLast {
sourceSets.main.compileClasspath += files(project(':gltf').sourceSets.main.allJava.srcDirs)
sourceSets.main.compileClasspath += files(project(':demo:core').sourceSets.main.allJava.srcDirs)
}
}

tasks.compileGwt.dependsOn(addSource)
tasks.draftCompileGwt.dependsOn(addSource)
tasks.checkGwt.dependsOn(addSource)

sourceCompatibility = 1.6
sourceSets.main.java.srcDirs = [ "src/" ]
Expand Down
2 changes: 1 addition & 1 deletion demo/html/src/net/mgsx/gltf/demo/GdxDefinition.gwt.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://www.gwtproject.org/doctype/2.8.0/gwt-module.dtd">
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.8.2//EN" "http://www.gwtproject.org/doctype/2.8.2/gwt-module.dtd">
<module rename-to="html">
<inherits name='com.badlogic.gdx.backends.gdx_backends_gwt' />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://www.gwtproject.org/doctype/2.8.0/gwt-module.dtd">
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.8.2//EN" "http://www.gwtproject.org/doctype/2.8.2/gwt-module.dtd">
<module rename-to="html">
<inherits name='com.badlogic.gdx.backends.gdx_backends_gwt' />

Expand Down
Loading

0 comments on commit 2c31fd5

Please sign in to comment.