Commit 6694c345 authored by Stephanie Gawroriski's avatar Stephanie Gawroriski
Browse files

Correct project building and importing for VSCode.

parent c6ba6773
Pipeline #110471 passed with stages
in 1 minute and 36 seconds
......@@ -6,6 +6,13 @@ build/
out/
*/out/
# Eclipse
.settings
.classpath
.project
emulators/*/bin
modules/*/bin
# IntelliJ (Shared but not used)
.idea/aws.xml
.idea/dbnavigator.xml
......@@ -40,6 +47,7 @@ modules/*/out/test/
*-original-*
# Binary Files
*.class
*.ico
*.png
*.sqc
......
......@@ -6,6 +6,13 @@ build/
out/
*/out/
# Eclipse
.settings
.classpath
.project
emulators/*/bin
modules/*/bin
# IntelliJ (Shared but not used)
.idea/aws.xml
.idea/dbnavigator.xml
......@@ -40,6 +47,7 @@ modules/*/out/test/
*-original-*
# Binary Files
*.class
*.ico
*.png
*.sqc
......
import java.nio.file.Files
import java.nio.file.StandardOpenOption
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'cc.squirreljme.plugin.general'
group = "cc.squirreljme"
......@@ -22,6 +26,7 @@ idea
excludeDirs += file(".github")
excludeDirs += file(".idea")
excludeDirs += file(".vscode")
excludeDirs += file(".settings")
excludeDirs += file("assets")
excludeDirs += file("config")
excludeDirs += file("gradle")
......@@ -34,15 +39,75 @@ idea
// IntelliJ's own dependency matrix output (in "out")
project.allprojects.each() { Project subProj ->
excludeDirs += subProj.projectDir.toPath().resolve("out").toFile()
// Eclipse Junk
excludeDirs += subProj.projectDir.toPath().resolve(".settings").toFile()
excludeDirs += subProj.projectDir.toPath().resolve("bin").toFile()
}
}
}
allprojects
{
allprojects {
apply plugin: 'eclipse'
repositories
{
mavenCentral()
jcenter()
}
// Eclipse IDE
plugins.withType(JavaPlugin) {
def settingsDir = projectDir.toPath().resolve(".settings")
def buildShipPrefs = settingsDir.resolve("org.eclipse.buildship.core.prefs")
def pathToRoot = projectDir.toPath().relativize(rootDir.toPath())
// Fix build
task eclipseFixBuild {
group "squirreljme"
description "Fixes Eclipse build due to missing expected files."
doFirst {
// Setup settings directory first
Files.createDirectories(settingsDir)
// Write missing Eclipse file
Files.write(
buildShipPrefs,
Arrays.asList(
"connection.project.dir=" + pathToRoot,
"eclipse.preferences.version=1"),
StandardOpenOption.CREATE,
StandardOpenOption.WRITE,
StandardOpenOption.TRUNCATE_EXISTING)
}
}
// Clean fix
task cleanEclipseFixBuild {
group "squirreljme"
description "Cleans up after build fixes."
doFirst {
// Just delete the buildship preferences
Files.deleteIfExists(buildShipPrefs)
}
}
// Fix for cyclic dependencies
eclipse.jdt {
// We are a Java 8 project
sourceCompatibility = 1.8
targetCompatibility = 1.8
// Fix for Eclipse and VSCode breaking on "circular" dependencies
file.withProperties { properties ->
properties["org.eclipse.jdt.core.builder.invalidClasspath"] = "warning"
properties["org.eclipse.jdt.core.circularClasspath"] = "warning"
properties["org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource"] = "warning"
}
}
eclipseJdt.finalizedBy(eclipseFixBuild)
cleanEclipseJdt.finalizedBy(cleanEclipseFixBuild)
}
}
......@@ -69,7 +69,9 @@ available.
* Gentoo
* See <https://wiki.gentoo.org/wiki/Java>
### IntelliJ IDEA (Optional)
### Running via IDEs
#### IntelliJ IDEA
SquirrelJME is developed on IntelliJ Ultimate, however Community Edition may
still be used. This makes development easier and more integrated along with
......@@ -78,6 +80,35 @@ SquirrelJME.
* <https://www.jetbrains.com/idea/>
#### VSCode
The following extensions are required to build and run SquirrelJME in VSCode:
* [Extension Pack for Java](
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack)
* `ext install vscjava.vscode-java-pack`
* [Gradle for Java](
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-gradle)
* `ext install vscjava.vscode-gradle`
Before running on VSCode you must run the following Gradle command, since this
uses a similar code base that is borrowed from Eclipse:
* Setup Eclipse Project
* Windows: `gradlew eclipse`
* Linux/MacOS: `./gradlew eclipse`
#### Eclipse
Before running on Eclipse you must run the following Gradle command:
* Setup Eclipse Project
* Windows: `gradlew eclipse`
* Linux/MacOS: `./gradlew eclipse`
Then following this you may _Import Existing Gradle Project_ and you will have
access to the project for building.
## Installing C++ Compiler
### Common Linux Distributions
......
......@@ -4,6 +4,7 @@ plugins
id "cpp-library"
id "java-library"
id "java-test-fixtures"
id "eclipse"
}
description = "This library provides the base support for testing and " +
......
plugins
{
id "java-library"
id "eclipse"
}
description = "This is a SpringCoat virtual machine which " +
......
plugins
{
id "java-library"
id "eclipse"
}
description = "This is the SummerCoat VM which is a more " +
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment