Skip to content

Commit

Permalink
build: Bump to VanillaGradle 0.2 and Gradle 7 (#3381)
Browse files Browse the repository at this point in the history
This is likely require a full re-import in most IDEs due to some
organizational changes.
  • Loading branch information
zml2008 authored Apr 26, 2021
1 parent 10f6daf commit 8521dfd
Show file tree
Hide file tree
Showing 31 changed files with 1,072 additions and 812 deletions.
17 changes: 0 additions & 17 deletions .run/Sponge (vanilla_client) _macOS .run.xml

This file was deleted.

17 changes: 0 additions & 17 deletions .run/Vanilla Client Dev.run.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .run/Vanilla Server Dev.run.xml

This file was deleted.

22 changes: 22 additions & 0 deletions HEADER.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
This file is part of ${name}, licensed under the MIT License (MIT).

Copyright (c) ${organization} <${url}>
Copyright (c) contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
38 changes: 21 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ The SpongeAPI implementation targeting vanilla Minecraft and 3rd party platforms
* [Source]
* [Issues]
* [Documentation]
* [Discord]: [#sponge ]
* [Discord]: `#sponge`

## Latest Builds

### Sponge

**1.16.4**: ![Snapshots](https://img.shields.io/nexus/maven-snapshots/org.spongepowered/sponge?label=Sponge&server=https%3A%2F%2Frepo-new.spongepowered.org%2F)
**1.16.5**: ![Snapshots](https://img.shields.io/nexus/maven-snapshots/org.spongepowered/sponge?label=Sponge&server=https%3A%2F%2Frepo-new.spongepowered.org%2F)

### SpongeVanilla

**1.16.4**: ![Snapshots](https://img.shields.io/nexus/maven-releases/org.spongepowered/spongevanilla?label=SpongeVanilla&server=https%3A%2F%2Frepo-new.spongepowered.org%2F)
**1.16.5**: ![Snapshots](https://img.shields.io/nexus/maven-releases/org.spongepowered/spongevanilla?label=SpongeVanilla&server=https%3A%2F%2Frepo-new.spongepowered.org%2F)


## Prerequisites
Expand All @@ -32,32 +32,35 @@ The following steps will ensure your project is cloned properly.

## Setup
**Note**: Sponge uses [Gradle] as its build system. The repo includes the Gradle wrapper that will automatically download the correct Gradle
version. Local installations of Gradle may work but are untested. To execute the Gradle wrapper, run the `./gradlew` script on Unix systems or only
`gradlew` on Windows systems.
version. Local installations of Gradle may work (as long as they are using Gradle 6.8+) but are untested. To execute the Gradle wrapper, run the
`./gradlew` script on Unix systems or only `gradlew` on Windows systems.

Before you are able to build Sponge, you must first prepare the environment (some IDEs may do this for you).

- Run `./gradlew build --refresh-dependencies`

Even if this fails to compile Sponge, it will download all the dependencies so you can get started.
To have browsable sources for use in-IDE, run `./gradlew :decompile`. This command will need to be re-ran after any change to
Minecraft version or to `.accesswidener` files. If sources are not appearing properly, an IDE refresh should fix things.

### IDE Setup
__For [Eclipse]__
1. Run `./gradlew eclipse`
2. Import Sponge as an existing project (File > Import > General)
3. Select the root folder for Sponge and make sure `Search for nested projects` is enabled
4. Check Sponge when it finishes building and click **Finish**
1. Make sure the Buildship plugin is installed (available on the [Eclipse Marketplace])
2. Import the project as an *Existing Gradle Project* (via File > Import > Gradle)

While we do our best to support any IDE, most of our developers use IntelliJ, so issues may pop up with Eclipse from time to time.
We'll be happy to work to resolve those issues if reported via [our issues page][Issues] or fixed via PR.

__For [IntelliJ]__
1. Make sure you have the Gradle plugin enabled (File > Settings > Plugins).
2. Click File > New > Project from Existing Sources > Gradle and select the root folder for Sponge.
3. Make sure _Use default gradle wrapper_ is selected. Older/newer Gradle versions may work but we only test using the wrapper.

For both Eclipse and IntelliJ, a variety of run configurations will be generated which allow running the client and server in development. These run
configurations will be re-generated on each project import, so any desired modifications should be done on copies of the configurations.

While these run configurations have Java versions attached to them, be aware that IntelliJ ignores that information entirely, and Eclipse will
only be able to align those java versions with whatever JREs it is aware of.

## Building
__Note:__ You must [Setup the environment](#setup) before you can build Sponge.

In order to build Sponge you simply need to run the `gradlew` command. On Windows systems you should run `gradlew` instead of `./gradlew` to
invoke the Gradle wrapper. You can find the compiled JAR files in `./build/libs`.
In order to build Sponge you simply need to run the `gradlew build` command. On Windows systems you should run `gradlew build` instead
of `./gradlew build` to invoke the Gradle wrapper. You can find the compiled JAR files in `./build/libs` and `./vanilla/build/libs`.

## Updating your Clone
The following steps will update your clone with the official repo.
Expand All @@ -72,6 +75,7 @@ Are you a talented programmer looking to contribute some code? We'd love the hel
* Please follow the above guidelines for your pull request(s) to be accepted.

[Eclipse]: https://eclipse.org/
[Eclipse Marketplace]: http://marketplace.eclipse.org/content/buildship-gradle-integration
[Gradle]: https://gradle.org/
[Homepage]: https://spongepowered.org/
[IntelliJ]: http://www.jetbrains.com/idea/
Expand Down
24 changes: 24 additions & 0 deletions build-logic/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
plugins {
id "java-gradle-plugin"
id "org.spongepowered.gradle.sponge.dev" version "1.0.3"
}

repositories {
maven {
url = "https://repo.spongepowered.org/repository/maven-public"
name = "sponge"
}
}

dependencies {
implementation("com.google.code.gson:gson:2.8.6")
}

gradlePlugin {
plugins {
impl {
id = "implementation-structure"
implementationClass = "org.spongepowered.gradle.impl.SpongeImplementationPlugin"
}
}
}
1 change: 1 addition & 0 deletions build-logic/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = "build-logic"
Loading

0 comments on commit 8521dfd

Please sign in to comment.