Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
pop4959 committed Nov 8, 2021
0 parents commit 5f50efb
Show file tree
Hide file tree
Showing 12 changed files with 538 additions and 0 deletions.
118 changes: 118 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# User-specific stuff
.idea/

*.iml
*.ipr
*.iws

# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

.gradle
build/

# Ignore Gradle GUI config
gradle-app.setting

# Cache of project
.gradletasknamecache

**/build/

# Common working directory
run/

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
73 changes: 73 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import java.io.ByteArrayOutputStream

plugins {
id("java-library")
id("maven-publish")
id("com.github.johnrengelman.shadow") version "7.0.0"
}

subprojects {
plugins.apply("java-library")
plugins.apply("maven-publish")
plugins.apply("com.github.johnrengelman.shadow")

group = "${project.property("group")}"
version = "${project.property("version")}.${commitsSinceLastTag()}"

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(16))
}
withSourcesJar()
}

tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
}
jar {
archiveClassifier.set("noshade")
}
shadowJar {
archiveClassifier.set("")
archiveFileName.set("${rootProject.name.capitalize()}-${project.version}.jar")
}
build {
dependsOn(shadowJar)
}
}

publishing {
repositories {
if (project.hasProperty("mavenUsername") && project.hasProperty("mavenPassword")) {
maven {
credentials {
username = "${project.property("mavenUsername")}"
password = "${project.property("mavenPassword")}"
}
url = uri("https://repo.codemc.io/repository/maven-releases/")
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = "${project.group}"
artifactId = project.name
version = "${project.version}"
from(components["java"])
}
}
}
}

fun commitsSinceLastTag(): String {
val tagDescription = ByteArrayOutputStream()
exec {
commandLine("git", "describe", "--tags")
standardOutput = tagDescription
}
if (tagDescription.toString().indexOf('-') < 0) {
return "0"
}
return tagDescription.toString().split('-')[1]
}
32 changes: 32 additions & 0 deletions bukkit/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
repositories {
mavenCentral()
maven("https://papermc.io/repo/repository/maven-public")
}

dependencies {
compileOnly(group = "org.spigotmc", name = "spigot-api", version = "1.17.1-R0.1-SNAPSHOT")
implementation(group = "io.papermc", name = "paperlib", version = "1.0.6")
implementation(group = "org.bstats", name = "bstats-bukkit", version = "2.2.1")
implementation(project(":bolt-common"))
}

tasks {
processResources {
filesMatching("plugin.yml") {
expand(
"name" to rootProject.name.capitalize(),
"version" to project.version,
"group" to project.group,
"author" to project.property("author"),
"description" to project.property("description"),
)
}
}
shadowJar {
minimize {
exclude(project(":bolt-common"))
}
relocate("io.papermc.lib", "${project.group}.${rootProject.name}.lib.paperlib")
relocate("org.bstats", "${project.group}.${rootProject.name}.lib.bstats")
}
}
Empty file added common/build.gradle.kts
Empty file.
6 changes: 6 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
org.gradle.jvmargs=-Xmx1G
group=org.popcraft
version=1.0
description=Protects blocks
github=https://github.com/pop4959/Bolt
author=pop4959
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 5f50efb

Please sign in to comment.