Skip to content

Commit

Permalink
Merge pull request #5700 from Tom-Ski/gradle541-update
Browse files Browse the repository at this point in the history
Gradle update project generator to version 5.4.1
  • Loading branch information
Tom-Ski committed Jul 18, 2019
2 parents eea2459 + d01650d commit 6f65393
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 129 deletions.
Expand Up @@ -61,8 +61,6 @@ public static void addBuildScript(Language language, List<ProjectType> projects,

public static void addAllProjects(BufferedWriter wr) throws IOException {
write(wr, "allprojects {");
write(wr, "apply plugin: \"eclipse\"");
write(wr, "apply plugin: \"idea\"");
space(wr);
write(wr, "version = '1.0'");
write(wr, "ext {");
Expand Down Expand Up @@ -101,7 +99,7 @@ public static void addProject(Language language, ProjectType project, List<Depen
private static void addDependencies(Language language, ProjectType project, List<Dependency> dependencyList, BufferedWriter wr) throws IOException {
write(wr, "dependencies {");
if (!project.equals(ProjectType.CORE)) {
write(wr, "compile project(\":" + ProjectType.CORE.getName() + "\")");
write(wr, "implementation project(\":" + ProjectType.CORE.getName() + "\")");
}
for (Dependency dep : dependencyList) {
if (dep.getDependencies(project) == null) continue;
Expand All @@ -110,7 +108,7 @@ private static void addDependencies(Language language, ProjectType project, List
if ((project.equals(ProjectType.ANDROID) || project.equals(ProjectType.IOSMOE)) && moduleDependency.contains("native")) {
write(wr, "natives \"" + moduleDependency + "\"");
} else {
write(wr, "compile \"" + moduleDependency + "\"");
write(wr, "api \"" + moduleDependency + "\"");
}
}
}
Expand Down
Expand Up @@ -22,10 +22,10 @@
public class DependencyBank {

//Versions
static String libgdxVersion = "1.9.9";
static String libgdxVersion = "1.9.10-SNAPSHOT";
//Temporary snapshot version, we need a more dynamic solution for pointing to the latest nightly
static String libgdxNightlyVersion = "1.9.10-SNAPSHOT";
static String roboVMVersion = "2.3.6";
static String roboVMVersion = "2.3.7";
static String moeVersion = "1.4.0";
static String buildToolsVersion = "28.0.3";
static String androidAPILevel = "28";
Expand All @@ -41,8 +41,8 @@ public class DependencyBank {
static String libGDXReleaseUrl = "https://oss.sonatype.org/content/repositories/releases/";

//Project plugins
static String gwtPluginImport = "org.wisepersist:gwt-gradle-plugin:1.0.6";
static String androidPluginImport = "com.android.tools.build:gradle:3.2.0";
static String gwtPluginImport = "org.wisepersist:gwt-gradle-plugin:1.0.9";
static String androidPluginImport = "com.android.tools.build:gradle:3.4.1";
static String roboVMPluginImport = "com.mobidevelop.robovm:robovm-gradle-plugin:" + roboVMVersion;
static String moePluginImport = "org.multi-os-engine:moe-gradle:" + moeVersion;

Expand Down
16 changes: 10 additions & 6 deletions extensions/gdx-setup/src/com/badlogic/gdx/setup/GdxSetupUI.java
Expand Up @@ -530,16 +530,20 @@ private void uiLayout () {
for (final ProjectType projectType : ProjectType.values()) {
if (projectType.equals(ProjectType.CORE)) {
continue;
}
}
if (projectType == ProjectType.IOSMOE) {
//Disable
continue;
}

SetupCheckBox checkBox = new SetupCheckBox(projectType.getName().substring(0, 1).toUpperCase() + projectType.getName().substring(1, projectType.getName().length()));
if (projectType == ProjectType.HTML) {
gwtCheckBox = checkBox;
}

if (projectType != ProjectType.IOSMOE) {
modules.add(projectType);
checkBox.setSelected(true);
}

modules.add(projectType);
checkBox.setSelected(true);

subProjectsPanel.add(checkBox);
checkBox.addItemListener(new ItemListener() {
@Override
Expand Down
@@ -1,7 +1,7 @@
package com.badlogic.gdx.setup;

public enum Language {
JAVA ("java", "", "", "", "java;java;android;java,robovm;moe;gwt,war", true) ,
JAVA ("java", "", "", "", "java-library;java-library;android;java-library,robovm;java-library,moe;java-library,gwt,war", true) ,
KOTLIN ("kotlin", "ext.kotlinVersion = '1.2.71'",
"classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion\"",
"compile \"org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion\"",
Expand Down
Expand Up @@ -84,11 +84,6 @@ public boolean build(Language language) throws IOException {
BuildScriptHelper.addProject(language, module, dependencies, buildBw);
}

//Add task here for now
buildBw.write("\n");
buildBw.write("tasks.eclipse.doLast {\n");
buildBw.write(" delete \".project\"\n");
buildBw.write("}");

buildBw.close();
buildWriter.close();
Expand Down
Expand Up @@ -88,57 +88,3 @@ task run(type: Exec) {
def adb = path + "/platform-tools/adb"
commandLine "$adb", 'shell', 'am', 'start', '-n', '%PACKAGE%/%PACKAGE%.AndroidLauncher'
}

// sets up the Android Eclipse project, using the old Ant based build.
eclipse {
// need to specify Java source sets explicitly, SpringSource Gradle Eclipse plugin
// ignores any nodes added in classpath.file.withXml
sourceSets {
main {
java.srcDirs "src", 'gen'
}
}

jdt {
sourceCompatibility = 1.6
targetCompatibility = 1.6
}

classpath {
plusConfigurations += [ project.configurations.compile ]
containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES'
}

project {
name = appName + "-android"
natures 'com.android.ide.eclipse.adt.AndroidNature'
buildCommands.clear();
buildCommand "com.android.ide.eclipse.adt.ResourceManagerBuilder"
buildCommand "com.android.ide.eclipse.adt.PreCompilerBuilder"
buildCommand "org.eclipse.jdt.core.javabuilder"
buildCommand "com.android.ide.eclipse.adt.ApkBuilder"
}
}

// sets up the Android Idea project, using the old Ant based build.
idea {
module {
sourceDirs += file("src");
scopes = [ COMPILE: [plus:[project.configurations.compile]]]

iml {
withXml {
def node = it.asNode()
def builder = NodeBuilder.newInstance();
builder.current = node;
builder.component(name: "FacetManager") {
facet(type: "android", name: "Android") {
configuration {
option(name: "UPDATE_PROPERTY_FILES", value:"true")
}
}
}
}
}
}
}
Expand Up @@ -4,8 +4,3 @@ sourceCompatibility = 1.6
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

sourceSets.main.java.srcDirs = [ "src/" ]


eclipse.project {
name = appName + "-core"
}
Expand Up @@ -2,9 +2,10 @@ apply plugin: "%LANG%"

sourceCompatibility = 1.6
sourceSets.main.java.srcDirs = [ "src/" ]
sourceSets.main.resources.srcDirs = ["../%ASSET_PATH%"]

project.ext.mainClassName = "%PACKAGE%.desktop.DesktopLauncher"
project.ext.assetsDir = new File("../%ASSET_PATH%");
project.ext.assetsDir = new File("../%ASSET_PATH%")

task run(dependsOn: classes, type: JavaExec) {
main = project.mainClassName
Expand All @@ -24,32 +25,14 @@ task debug(dependsOn: classes, type: JavaExec) {
}

task dist(type: Jar) {
from files(sourceSets.main.output.classesDir)
from files(sourceSets.main.output.resourcesDir)
from {configurations.compile.collect {zipTree(it)}}
from files(project.assetsDir);

manifest {
attributes 'Main-Class': project.mainClassName
}
}

dist.dependsOn classes

eclipse {
project {
name = appName + "-desktop"
linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/%ASSET_PATH%'
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
with jar
}

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)
}
}

dist.dependsOn classes
Binary file not shown.
@@ -1,6 +1,5 @@
#Fri Jun 09 23:06:52 EDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
24 changes: 20 additions & 4 deletions extensions/gdx-setup/src/com/badlogic/gdx/setup/resources/gradlew
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,16 +44,16 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -155,7 +171,7 @@ if $cygwin ; then
fi

# Escape application args
save ( ) {
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
Expand Down
@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
Expand All @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
Expand Up @@ -78,8 +78,3 @@ tasks.draftCompileGwt.dependsOn(addSource)

sourceCompatibility = 1.6
sourceSets.main.java.srcDirs = [ "src/" ]


eclipse.project {
name = appName + "-html"
}
Expand Up @@ -52,12 +52,3 @@ moeMainReleaseIphoneosXcodeBuild.dependsOn copyNatives
moeMainDebugIphoneosXcodeBuild.dependsOn copyNatives
moeMainReleaseIphonesimulatorXcodeBuild.dependsOn copyNatives
moeMainDebugIphonesimulatorXcodeBuild.dependsOn copyNatives

// Setup Eclipse
eclipse {
// Set Multi-OS Engine nature
project {
name = appName + "-ios-moe"
natures 'org.multi-os-engine.project'
}
}
Expand Up @@ -15,8 +15,3 @@ createIPA.dependsOn build
robovm {
archs = "thumbv7:arm64"
}

eclipse.project {
name = appName + "-ios"
natures 'org.robovm.eclipse.RoboVMNature'
}

0 comments on commit 6f65393

Please sign in to comment.