Re-organising structure

This commit is contained in:
Sekwah 2021-05-25 01:32:22 +01:00
parent 2d9a24716e
commit ce94280b45
No known key found for this signature in database
GPG Key ID: C3BE2E6C861A461A
16 changed files with 109 additions and 43 deletions

View File

@ -18,11 +18,25 @@ const bungee = {
...ymlUpdater,
}
const plugin = {
filename: 'src/main/resources/plugin.yml',
const spigotPlugin = {
filename: 'spigot/src/main/resources/plugin.yml',
...ymlUpdater,
}
const gradleTracker = {
filename: 'gradle.properties',
updater: {
'readVersion': (contents) => {
return versionRegex.exec(contents)[2];
},
'writeVersion': (contents, version) => {
return contents.replace(versionRegex, `$1${version}`);
}
}
}
const velocity_plugin = {
filename: 'src/main/java/com/sekwah/advancedportals/velocity/AdvancedPortalsPlugin.java',
updater: {
@ -35,7 +49,7 @@ const velocity_plugin = {
}
}
const files = [plugin, velocity_plugin, bungee];
const files = [gradleTracker] // spigotPlugin, velocity_plugin, bungee
module.exports = {
bumpFiles: files,

View File

@ -12,10 +12,13 @@ Though due to incompatibilities and keeping the files smaller, we will be making
## Common
* **api**: All code for adding tags and creating addons.
* **core**: Functional code with an abstraction layer to create consistent behavior between platforms.
* **lang**: Translations of the plugin available by default.
## Implementations
* **spigot**: All functionality for spigot to connect the abstraction layer.
More will be coming once we have finished the recode.
## Proxy's
* **bungee**: Bungee plugin to allow secure connections between severs.
* **velocity**: Velocity proxy plugin,
@ -62,6 +65,4 @@ We don't currently do tests. But in case.
-->
## Scopes available
Scopes are only needed if relating to specific features just to make them easier to find.
_I'll expand the list as I work more on the project._
* **proxy** (Proxy specific features and issues)
The scopes available should be the specific modules being worked on. E.g. core, spigot, docs

35
api/build.gradle Normal file
View File

@ -0,0 +1,35 @@
apply plugin: 'maven-publish'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'java'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
configurations {
// configuration that holds jars to copy into lib
includeLibs
}
repositories {
maven { url "https://repo.maven.apache.org/maven2" }
}
// includeLibs just says to include the library in the final jar
dependencies {
}
jar {
from configurations.includeLibs.collect { it.isDirectory() ? it : zipTree(it) }
}
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

View File

@ -14,14 +14,13 @@ import org.apache.http.impl.client.HttpClients
import org.apache.http.client.methods.HttpGet
import com.google.gson.Gson
apply plugin: 'maven-publish'
apply plugin: 'idea'
apply plugin: 'eclipse'
// A little messier/not advised but
allprojects {
apply plugin: 'java'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
@ -68,10 +67,12 @@ repositories {
// includeLibs just says to include the library in the final jar
dependencies {
includeLibs project(':api')
includeLibs project(':lang')
includeLibs project(':core')
//implementation project(':bungee')
//implementation project(':spigot')
//implementation project(':velocity')
includeLibs project(':bungee')
includeLibs project(':spigot')
includeLibs project(':velocity')
}

View File

@ -1,4 +1,9 @@
apply plugin: 'maven-publish'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'java'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
@ -34,19 +39,6 @@ jar {
from configurations.includeLibs.collect { it.isDirectory() ? it : zipTree(it) }
}
// Set SPIGOT_LOC to the location of your server and SPIGOT_JAR as the name of the jar file in the server you want to run
// DIReallyKnowWhatIAmDoingISwear is to remove the stupid pause spigot has at the start
task runJar() {
doLast {
javaexec {
main "-jar"
args "${System.env.MC_SERVER_LOC}\\${System.env.MC_SERVER_JAR}.jar"
jvmArgs = ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005", "-DIReallyKnowWhatIAmDoingISwear=true"]
workingDir "${System.env.MC_SERVER_LOC}"
}
}
}
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.

View File

@ -1,3 +1,6 @@
apply plugin: 'maven-publish'
apply plugin: 'idea'
apply plugin: 'eclipse'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'

6
docs/README.md Normal file
View File

@ -0,0 +1,6 @@
Advanced Portals Documentation
=============================
# Changelogs
* [Main Release Changelogs](./changelogs/CHANGELOG.md)
* [Snapshot Release Changelogs](./changelogs/SNAPSHOT_CHANGELOG.md)

View File

@ -1,6 +1,7 @@
z# https://docs.gradle.org/current/userguide/build_environment.html
# Disable with --no-build-cache
org.gradle.caching=true
version=1.0.0-0
github=https://github.com/sekwah41/Advanced-Portals
curse_project_id=86001

3
lang/build.gradle Normal file
View File

@ -0,0 +1,3 @@
// Check the root build.gradle under allprojects for common settings

View File

@ -2,6 +2,7 @@ rootProject.name = "advanced-portals"
// Core modules
include 'core'
include 'api'
include 'lang'
// Implementations
include 'spigot'

View File

@ -1,7 +1,4 @@
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
// Check the root build.gradle under allprojects for common settings
configurations {
// configuration that holds jars to copy into lib
@ -26,16 +23,3 @@ jar {
it.isDirectory() ? it : zipTree(it)
}
}
// Set SPIGOT_LOC to the location of your server and SPIGOT_JAR as the name of the jar file in the server you want to run
// DIReallyKnowWhatIAmDoingISwear is to remove the stupid pause spigot has at the start
task runJar() {
doLast {
javaexec {
main "-jar"
args "${System.env.MC_SERVER_LOC}\\${System.env.MC_SERVER_JAR}.jar"
jvmArgs = ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005", "-DIReallyKnowWhatIAmDoingISwear=true"]
workingDir "${System.env.MC_SERVER_LOC}"
}
}
}

25
velocity/build.gradle Normal file
View File

@ -0,0 +1,25 @@
// Check the root build.gradle under allprojects for common settings
configurations {
// configuration that holds jars to copy into lib
includeLibs
}
repositories {
maven { url "https://repo.maven.apache.org/maven2" }
maven { url "https://nexus.velocitypowered.com/repository/maven-public/" }
}
// includeLibs just says to include the library in the final jar
dependencies {
implementation project(":core")
implementation "com.velocitypowered:velocity-api:1.1.0-SNAPSHOT"
annotationProcessor "com.velocitypowered:velocity-api:1.1.0-SNAPSHOT"
}
jar {
from configurations.includeLibs.collect {
it.isDirectory() ? it : zipTree(it)
}
}