Skip to content

Commit

Permalink
build: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro committed Jul 9, 2023
0 parents commit 32a7fe2
Show file tree
Hide file tree
Showing 79 changed files with 5,035 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [ aaxyria ]
31 changes: 31 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Kotlin Code Analysis

on:
- push
- pull_request

jobs:
gradle:
strategy:
matrix:
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Restore build cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Perform code analysis
run: ./gradlew check
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# gradle
.gradle/
build/
bin/
run/
!src/**/bin/
!src/**/run/
hs_err_*.log
replay_*.log
*.hprof
*.jfr

# editor-specific
*.launch
.idea/
*.iml
*.ipr
*.iws
.settings/
.vscode/
.classpath
.project
.bloop
.metals
15 changes: 15 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 📜 Licensing

## Software

The software in this repository is licensed under the
[GNU Affero General Public License v3.0 (AGPLv3)](https://www.gnu.org/licenses/agpl-3.0.en.html).
Please read the [LICENSE-AGPLv3](./licenses/AGPLv3) file for the full text
of the license.

## Artwork

The artwork in this repository is licensed under the
[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC-BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/).
Please read the [LICENSE-CC-BY-NC-SA-4.0](./licenses/CC-BY-NC-SA-4.0) file
for the full text of the license.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<h1>
<img width="32px" height="32px" alt="" src="./artwork/branding/logo@10x.png" />
<code>warpedvoxels</code>
</h1>
<a href="https://discord.gg/gRFnmxHkFb">
<img src="https://img.shields.io/discord/908438033613848596?colorA=1e1e28&colorB=f5c858&style=for-the-badge&logo=discord&logoColor=f5c858" />
</a>

**Welcome to WarpedVoxels' Git mono-repository!** This is where
development and artistry merge to bring content to life.

We are dedicated to create and use technologies that ensure our
codebase is clean, modern, performant, and developer-friendly.

Our focus is on crafting an immersive experience that captivates
players and pushes the boundaries of Minecraft: Java Edition gameplay.

## 📚 Table of contents

* [🖍 Getting Started]: A guide on setting up a development workflow for
WarpedVoxels.
* [🧙🏻‍♀️️ Witchcraft]: In-depth explanation of how our in-game effects work
behind the scenes.
* [📜 Licensing]: Information about the licensing of WarpedVoxels.

[🖍 Getting Started]: https://github.com/WarpedVoxels/java-edition/blob/trunk/docs/getting_started.md

[🧙🏻‍♀️️ Witchcraft]: https://github.com/WarpedVoxels/java-edition/blob/trunk/docs/witchcraft.md

[📜 Licensing]: https://github.com/WarpedVoxels/java-edition/blob/trunk/docs/LICENSE.md

## ⚠️ Disclaimer

Minecraft is intellectual property of Mojang Studios, and it is solely
mentioned for descriptive purposes. WarpedVoxels is not associated with
or endorsed by Mojang Studios.

Any references to Minecraft within this repository are purely for
descriptive purposes to provide context and showcase the work done by
the WarpedVoxels team and community.
Binary file added artwork/branding/logo-disintegrating.aseprite
Binary file not shown.
Binary file added artwork/branding/logo-full-disintegrating.aseprite
Binary file not shown.
Binary file added artwork/branding/logo-full.aseprite
Binary file not shown.
Binary file added artwork/branding/logo-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/branding/logo-full@10x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/branding/logo-full@20x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/branding/logo.aseprite
Binary file not shown.
Binary file added artwork/branding/logo@10x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 69 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* WarpedVoxels, a network of Minecraft: Java Edition servers
* Copyright (C) 2023 Pedro Henrique
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import net.warpedvoxels.gradle.JVM_TARGET
import net.warpedvoxels.gradle.KOTLIN_ARGS

plugins {
id("voxels-gradle-plugin")
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.shadow) apply false
alias(libs.plugins.paperweight.userdev) apply false
alias(libs.plugins.run.paper) apply false
}

allprojects {
apply(plugin = "org.jetbrains.kotlin.jvm")

repositories {
mavenCentral()
maven(url = "https://libraries.minecraft.net/") {
name = "Minecraft Libraries"
}
maven(url = "https://repo.papermc.io/repository/maven-public/") {
name = "PaperMC"
}
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(JVM_TARGET))
}
}
kotlin {
explicitApi()
}
tasks {
compileKotlin {
kotlinOptions.freeCompilerArgs = KOTLIN_ARGS
kotlinOptions.jvmTarget = "$JVM_TARGET"
}
compileTestKotlin {
kotlinOptions.freeCompilerArgs = KOTLIN_ARGS
kotlinOptions.jvmTarget = "$JVM_TARGET"
}
jar {
from(rootProject.file("LICENSE"))
}
test {
useJUnitPlatform()
}
}
}

13 changes: 13 additions & 0 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 🖍 Getting Started

Hello! I'd like to start this guide by thanking you for being interested
in this project, this is a simple guide on setting up a development
environment or self-hosting WarpedVoxels servers.

## Prerequisites

* Git;
* Java Development Kit version 17 or newer;
* Docker;

[todo]
3 changes: 3 additions & 0 deletions docs/witchcraft.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 🧙🏻‍♀️️ Witchcraft

[todo]
50 changes: 50 additions & 0 deletions gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* WarpedVoxels, a network of Minecraft: Java Edition servers
* Copyright (C) 2023 Pedro Henrique
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
`kotlin-dsl`
`java-gradle-plugin`
}

repositories {
mavenCentral()
}

gradlePlugin {
plugins.register("voxels-gradle-plugin") {
id = "voxels-gradle-plugin"
implementationClass = "net.warpedvoxels.gradle.VoxelsGradlePlugin"
}
}

tasks {
compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(17)
}
javadoc {
options.encoding = Charsets.UTF_8.name()
}
processResources {
filteringCharset = Charsets.UTF_8.name()
}
compileKotlin {
kotlinOptions.jvmTarget = "17"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* WarpedVoxels, a network of Minecraft: Java Edition servers
* Copyright (C) 2023 Pedro Henrique
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package net.warpedvoxels.gradle

import org.gradle.api.Plugin
import org.gradle.api.Project

class VoxelsGradlePlugin : Plugin<Project> {
override fun apply(target: Project) {
// no-op
}
}
46 changes: 46 additions & 0 deletions gradle-plugin/src/main/kotlin/net/warpedvoxels/gradle/catalog.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* WarpedVoxels, a network of Minecraft: Java Edition servers
* Copyright (C) 2023 Pedro Henrique
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package net.warpedvoxels.gradle

import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalog
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.kotlin.dsl.getByType

inline fun Project.withCatalog(
name: String,
crossinline block: VersionCatalog.() -> Unit
) {
val libs = rootProject.extensions.getByType<VersionCatalogsExtension>()
pluginManager.withPlugin("java") {
val catalog = libs.named(name)
catalog.block()
}
}

fun VersionCatalog.version(name: String) =
findVersion(name).get().displayName

fun VersionCatalog.library(id: String) =
findLibrary(id).get().get().run {
"$module:${versionConstraint.displayName}"
}

fun VersionCatalog.pluginId(id: String) =
findPlugin(id).get().get().pluginId
39 changes: 39 additions & 0 deletions gradle-plugin/src/main/kotlin/net/warpedvoxels/gradle/kotlin.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* WarpedVoxels, a network of Minecraft: Java Edition servers
* Copyright (C) 2023 Pedro Henrique
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package net.warpedvoxels.gradle

import org.gradle.api.Project
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.kotlin

val KOTLIN_ARGS = listOf("-opt-in=kotlin.RequiresOptIn", "-Xcontext-receivers")
val JVM_TARGET = 17

fun Project.voxelsUseKotlin() = withCatalog("libs") {
apply(plugin = pluginId("kotlin-jvm"))
apply(plugin = pluginId("kotlin-serialization"))
dependencies {
"implementation"(library("kotlin-serialization"))
"implementation"(library("kotlin-coroutines"))
"implementation"(kotlin("reflect", version = version("kotlin")))
"testImplementation"(kotlin("test", version = version("kotlin")))
"testImplementation"(kotlin("test-junit5", version = version("kotlin")))
}
}
Loading

0 comments on commit 32a7fe2

Please sign in to comment.