Skip to content

Commit 8521dfd

Browse files
authored
build: Bump to VanillaGradle 0.2 and Gradle 7 (SpongePowered#3381)
This is likely require a full re-import in most IDEs due to some organizational changes.
1 parent 10f6daf commit 8521dfd

File tree

31 files changed

+1072
-812
lines changed

31 files changed

+1072
-812
lines changed

.run/Sponge (vanilla_client) _macOS .run.xml

-17
This file was deleted.

.run/Vanilla Client Dev.run.xml

-17
This file was deleted.

.run/Vanilla Server Dev.run.xml

-12
This file was deleted.

HEADER.txt

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
This file is part of ${name}, licensed under the MIT License (MIT).
2+
3+
Copyright (c) ${organization} <${url}>
4+
Copyright (c) contributors
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

README.md

+21-17
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ The SpongeAPI implementation targeting vanilla Minecraft and 3rd party platforms
77
* [Source]
88
* [Issues]
99
* [Documentation]
10-
* [Discord]: [#sponge ]
10+
* [Discord]: `#sponge`
1111

1212
## Latest Builds
1313

1414
### Sponge
1515

16-
**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)
16+
**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)
1717

1818
### SpongeVanilla
1919

20-
**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)
20+
**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)
2121

2222

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

3333
## Setup
3434
**Note**: Sponge uses [Gradle] as its build system. The repo includes the Gradle wrapper that will automatically download the correct Gradle
35-
version. Local installations of Gradle may work but are untested. To execute the Gradle wrapper, run the `./gradlew` script on Unix systems or only
36-
`gradlew` on Windows systems.
35+
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
36+
`./gradlew` script on Unix systems or only `gradlew` on Windows systems.
3737

38-
Before you are able to build Sponge, you must first prepare the environment (some IDEs may do this for you).
39-
40-
- Run `./gradlew build --refresh-dependencies`
41-
42-
Even if this fails to compile Sponge, it will download all the dependencies so you can get started.
38+
To have browsable sources for use in-IDE, run `./gradlew :decompile`. This command will need to be re-ran after any change to
39+
Minecraft version or to `.accesswidener` files. If sources are not appearing properly, an IDE refresh should fix things.
4340

4441
### IDE Setup
4542
__For [Eclipse]__
46-
1. Run `./gradlew eclipse`
47-
2. Import Sponge as an existing project (File > Import > General)
48-
3. Select the root folder for Sponge and make sure `Search for nested projects` is enabled
49-
4. Check Sponge when it finishes building and click **Finish**
43+
1. Make sure the Buildship plugin is installed (available on the [Eclipse Marketplace])
44+
2. Import the project as an *Existing Gradle Project* (via File > Import > Gradle)
45+
46+
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.
47+
We'll be happy to work to resolve those issues if reported via [our issues page][Issues] or fixed via PR.
5048

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

54+
For both Eclipse and IntelliJ, a variety of run configurations will be generated which allow running the client and server in development. These run
55+
configurations will be re-generated on each project import, so any desired modifications should be done on copies of the configurations.
56+
57+
While these run configurations have Java versions attached to them, be aware that IntelliJ ignores that information entirely, and Eclipse will
58+
only be able to align those java versions with whatever JREs it is aware of.
59+
5660
## Building
57-
__Note:__ You must [Setup the environment](#setup) before you can build Sponge.
5861

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

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

7477
[Eclipse]: https://eclipse.org/
78+
[Eclipse Marketplace]: http://marketplace.eclipse.org/content/buildship-gradle-integration
7579
[Gradle]: https://gradle.org/
7680
[Homepage]: https://spongepowered.org/
7781
[IntelliJ]: http://www.jetbrains.com/idea/

build-logic/build.gradle

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
plugins {
2+
id "java-gradle-plugin"
3+
id "org.spongepowered.gradle.sponge.dev" version "1.0.3"
4+
}
5+
6+
repositories {
7+
maven {
8+
url = "https://repo.spongepowered.org/repository/maven-public"
9+
name = "sponge"
10+
}
11+
}
12+
13+
dependencies {
14+
implementation("com.google.code.gson:gson:2.8.6")
15+
}
16+
17+
gradlePlugin {
18+
plugins {
19+
impl {
20+
id = "implementation-structure"
21+
implementationClass = "org.spongepowered.gradle.impl.SpongeImplementationPlugin"
22+
}
23+
}
24+
}

build-logic/settings.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = "build-logic"

0 commit comments

Comments
 (0)