Skip to content

Commit

Permalink
feat: multi project and lots of updates
Browse files Browse the repository at this point in the history
* now we're using a multi project system
* updated to the latest blossom to support new features
* removed .sdkmanrc
* added jitpack.yml
* added custom dotenv support
* updated to gradle 8.5
* updated dependencies
* removed .idea/ folder
* updated some workflow actions.

# What's next?
* finish setting up a new build system (the final jar should be written under ./build instead of ./simplecoreapi/build)
* finish adding modules
  • Loading branch information
Im-Fran committed Dec 23, 2023
1 parent a89f418 commit d9e23dd
Show file tree
Hide file tree
Showing 59 changed files with 217 additions and 424 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/gradle-build.yml → .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
types: [published,edited]
jobs:
build:
name: "Build and Deploy"
# Set up the OS
runs-on: ubuntu-latest
env:
Expand All @@ -27,31 +28,29 @@ jobs:
remove-first-character: 'v'
# Set up the JDK
- name: Set up JDK 11
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 11
cache: 'gradle'
# Make gradle executable
- name: Make gradle executable
run: chmod +x gradlew
# Clean, Test, Publish and Build (in that order to save the artifact to the action)
- name: Test, Deploy and Build with Gradle
run: ./gradlew clean test shadowJar dokkaHtml publish publishToSonatype closeAndReleaseSonatypeStagingRepository -no-daemon
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: clean test shadowJar dokkaHtml publish publishToSonatype closeAndReleaseSonatypeStagingRepository
# Now we store the artifact in the action
- name: Upload the artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v5
with:
name: SimpleCoreAPI
path: ./build/libs/SimpleCoreAPI-${{ env.VERSION }}.jar
path: ./simplecoreapi/build/libs/SimpleCoreAPI-${{ env.VERSION }}.jar
# Here we upload the binary to the release
- name: Upload to release
uses: JasonEtco/upload-to-release@master
with:
args: ./build/libs/SimpleCoreAPI-${{ env.VERSION }}.jar application/java-archive
args: ./simplecoreapi/build/libs/SimpleCoreAPI-${{ env.VERSION }}.jar application/java-archive
# Now we deploy the documents to GitHub pages
- name: Deploy Dokka
uses: JamesIves/github-pages-deploy-action@v4.4.3
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
branch: gh-pages
folder: build/dokka
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v4
# Setup java and maven
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: ${{ matrix.java-version }}
Expand Down
20 changes: 1 addition & 19 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,16 @@ dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
.idea/**/contentModel.xml
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
.idea/**/gradle.xml
.idea/**/libraries
cmake-build-*/
.idea/**/mongoSettings.xml
*.iws
out/
.idea_modules/
atlassian-ide-plugin.xml
.idea/replstate.xml
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
.idea/httpRequests
.idea/caches/build_file_checksums.ser
.idea/
*.class
*.log
*.ctxt
Expand Down
42 changes: 0 additions & 42 deletions .idea/compiler.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/discord.xml

This file was deleted.

70 changes: 0 additions & 70 deletions .idea/jarRepositories.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/kotlinc.xml

This file was deleted.

15 changes: 0 additions & 15 deletions .idea/misc.xml

This file was deleted.

11 changes: 0 additions & 11 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .sdkmanrc

This file was deleted.

34 changes: 34 additions & 0 deletions build-info/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
plugins {
id("net.kyori.blossom") version "2.1.0" // Placeholder injection
}

kotlin {
sourceSets {
main {
kotlin.srcDir("src/main/kotlin-templates")
resources.srcDir("src/main/resources-templates")
}
}
}

sourceSets {
main {
blossom {
val variables = mapOf(
"name" to rootProject.name,
"version" to "${project.version}",
"description" to project.description,
"git_short" to (env["GIT_COMMIT_SHORT_HASH"] ?: "unknown"),
"git_full" to (env["GIT_COMMIT_LONG_HASH"] ?: "unknown")
)

kotlinSources {
variables.forEach(this::property)
}

resources {
variables.forEach(this::property)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package xyz.theprogramsrc.simplecoreapi

/**
* Gets the short version of the commit hash
* @return The short commit hash
*/
const val getShortHash: String = "{{ git_short }}"

/**
* Gets the full version of the commit hash
* @return The full commit hash
*/
const val getFullHash: String = "{{ git_full }}"

/**
* Gets the version of SimpleCoreAPI
* @return The version of SimpleCoreAPI
*/
const val getVersion: String = "{{ version }}"

/**
* Gets the name of the project ('SimpleCoreAPI')
* @return The name of the project
*/
const val getName: String = "{{ name }}"

/**
* Gets the description of the project
* @return The description of the project
*/
const val getDescription: String = "{{ description }}"
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: 'SimpleCoreAPI'
main: 'xyz.theprogramsrc.simplecoreapi.bungee.BungeeLoader'
version: '@version@'
version: '{{ version }}'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'SimpleCoreAPI'
main: 'xyz.theprogramsrc.simplecoreapi.spigot.SpigotLoader'
version: '@version@'
version: '{{ version }}'
api-version: '1.13'
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "simplecoreapi",
"name": "SimpleCoreAPI",
"version": "@version@",
"version": "{{ version }}",
"url": "theprogramsrc.xyz",
"authors": ["TheProgramSrc"],
"main": "xyz.theprogramsrc.simplecoreapi.velocity.VelocityLoader"
Expand Down

0 comments on commit d9e23dd

Please sign in to comment.