Skip to content

Commit 9c30572

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents a2fbd32 + c0d99e2 commit 9c30572

23 files changed

Lines changed: 1354 additions & 774 deletions

File tree

.github/workflows/build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- develop
6+
- master
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
jobs:
10+
build:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
17+
- name: Set up JDK 11
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 11
21+
- name: Cache SonarCloud packages
22+
uses: actions/cache@v1
23+
with:
24+
path: ~/.sonar/cache
25+
key: ${{ runner.os }}-sonar
26+
restore-keys: ${{ runner.os }}-sonar
27+
- name: Cache Maven packages
28+
uses: actions/cache@v1
29+
with:
30+
path: ~/.m2
31+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
32+
restore-keys: ${{ runner.os }}-m2
33+
- name: Build and analyze
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
36+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
37+
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar

.gitignore

Lines changed: 122 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,134 @@
1-
# Compiled class file
2-
*.class
1+
### Others ###
2+
*.cmd
3+
*.sh
4+
*.prefs
5+
6+
### Maven ###
7+
/mvn
8+
/target/lib
9+
/target/maven-archiver
10+
/target/classes
11+
/target/maven-status
12+
pom.xml.tag
13+
pom.xml.releaseBackup
14+
pom.xml.versionsBackup
15+
pom.xml.next
16+
release.properties
17+
dependency-reduced-pom.xml
18+
buildNumber.properties
19+
.mvn/timing.properties
20+
out/
321

4-
# Log file
5-
*.log
622

7-
# BlueJ files
8-
*.ctxt
23+
### Java ###
24+
*.class
925

1026
# Mobile Tools for Java (J2ME)
1127
.mtj.tmp/
1228

1329
# Package Files #
14-
*.jar
1530
*.war
16-
*.nar
1731
*.ear
18-
*.zip
19-
*.tar.gz
20-
*.rar
2132

2233
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2334
hs_err_pid*
35+
36+
37+
### Intellij ###
38+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
39+
40+
*.iml
41+
42+
## Directory-based project format:
43+
.idea/
44+
# if you remove the above rule, at least ignore the following:
45+
46+
# User-specific stuff:
47+
.idea/workspace.xml
48+
.idea/tasks.xml
49+
.idea/dictionaries
50+
.idea/shelf
51+
52+
# Sensitive or high-churn files:
53+
.idea/dataSources.ids
54+
.idea/dataSources.xml
55+
.idea/sqlDataSources.xml
56+
.idea/dynamic.xml
57+
.idea/uiDesigner.xml
58+
59+
# Gradle:
60+
.idea/gradle.xml
61+
.idea/libraries
62+
.gradle
63+
64+
# Mongo Explorer plugin:
65+
# .idea/mongoSettings.xml
66+
67+
## File-based project format:
68+
*.ipr
69+
*.iws
70+
71+
## Plugin-specific files:
72+
73+
# IntelliJ
74+
/out/
75+
76+
# mpeltonen/sbt-idea plugin
77+
.idea_modules/
78+
79+
# JIRA plugin
80+
atlassian-ide-plugin.xml
81+
82+
# Crashlytics plugin (for Android Studio and IntelliJ)
83+
com_crashlytics_export_strings.xml
84+
crashlytics.properties
85+
crashlytics-build.properties
86+
fabric.properties
87+
88+
89+
### Eclipse ###
90+
*.pydevproject
91+
.metadata
92+
bin/
93+
tmp/
94+
*.tmp
95+
*.bak
96+
*.swp
97+
*~.nib
98+
local.properties
99+
.settings/
100+
.loadpath
101+
102+
# Eclipse Core
103+
.project
104+
105+
# External tool builders
106+
.externalToolBuilders/
107+
108+
# Locally stored "Eclipse launch configurations"
109+
*.launch
110+
111+
# CDT-specific
112+
.cproject
113+
114+
# JDT-specific (Eclipse Java Development Tools)
115+
.classpath
116+
117+
# Java annotation processor (APT)
118+
.factorypath
119+
120+
# PDT-specific
121+
.buildpath
122+
123+
# sbteclipse plugin
124+
.target
125+
126+
# TeXlipse plugin
127+
.texlipse
128+
129+
# STS (Spring Tool Suite)
130+
.springBeans
131+
/target/
132+
checkstyle.xml
133+
classes/
134+
/.DS_Store

pom.xml

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

77
<groupId>world.bentobox</groupId>
@@ -14,30 +14,31 @@
1414

1515
<inceptionYear>2019</inceptionYear>
1616

17-
<!-- SCM is a GitHub link to your project -->
18-
<!-- Can be removed -->
17+
<!-- SCM is a GitHub link to your project -->
18+
<!-- Can be removed -->
1919
<scm>
2020
<connection>scm:git:https://github.com/BentoBoxWorld/ControlPanel.git</connection>
2121
<developerConnection>scm:git:git@github.com:BentoBoxWorld/ControlPanel.git</developerConnection>
2222
<url>https://github.com/BentoBoxWorld/ControlPanel</url>
2323
</scm>
2424

25-
<!-- ciManagement is a build server that runs builds for your project -->
26-
<!-- Can be removed -->
25+
<!-- ciManagement is a build server that runs builds for your project -->
26+
<!-- Can be removed -->
2727
<ciManagement>
2828
<system>jenkins</system>
2929
<url>http://ci.codemc.org/job/BentoBoxWorld/job/ControlPanel</url>
3030
</ciManagement>
3131

32-
<!-- issueManagement is a link to issues page. -->
33-
<!-- Can be removed -->
32+
<!-- issueManagement is a link to issues page. -->
33+
<!-- Can be removed -->
3434
<issueManagement>
3535
<system>GitHub</system>
3636
<url>https://github.com/BentoBoxWorld/ControlPanel/issues</url>
3737
</issueManagement>
3838

39-
<!-- distributionManagement contains public maven repositories for your addon -->
40-
<!-- Can be removed -->
39+
<!-- distributionManagement contains public maven repositories for your
40+
addon -->
41+
<!-- Can be removed -->
4142
<distributionManagement>
4243
<snapshotRepository>
4344
<id>codemc-snapshots</id>
@@ -49,24 +50,29 @@
4950
</repository>
5051
</distributionManagement>
5152

52-
<!-- Properties contains all variables that can offten change, f.e. BentoBox API version -->
53+
<!-- Properties contains all variables that can offten change, f.e. BentoBox
54+
API version -->
5355
<properties>
54-
<!-- Some JAVA encoding settings -->
56+
<!-- Some JAVA encoding settings -->
5557
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5658
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
5759
<java.version>1.8</java.version>
5860

5961
<!-- SPIGOT API version -->
60-
<spigot.version>1.14.4-R0.1-SNAPSHOT</spigot.version>
62+
<spigot.version>1.15.2-R0.1-SNAPSHOT</spigot.version>
6163

6264
<!-- BentoBox API version -->
63-
<bentobox.version>1.7.0</bentobox.version>
65+
<bentobox.version>1.14.0</bentobox.version>
6466

6567
<!-- Revision variable removes warning about dynamic version -->
6668
<revision>${build.version}-SNAPSHOT</revision>
6769
<!-- This allows to change between versions and snapshots. -->
68-
<build.version>1.7.0</build.version>
70+
<build.version>1.13.0</build.version>
6971
<build.number>-LOCAL</build.number>
72+
<!-- Sonar Cloud -->
73+
<sonar.projectKey>BentoBoxWorld_ControlPanel</sonar.projectKey>
74+
<sonar.organization>bentobox-world</sonar.organization>
75+
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
7076
</properties>
7177

7278
<profiles>
@@ -79,7 +85,7 @@
7985
</activation>
8086
<properties>
8187
<!-- Override only if necessary -->
82-
<build.number>-#${env.BUILD_NUMBER}</build.number>
88+
<build.number>-b${env.BUILD_NUMBER}</build.number>
8389
<!-- GIT_BRANCH -->
8490
</properties>
8591
</profile>
@@ -94,13 +100,13 @@
94100
<properties>
95101
<!-- Override only if necessary -->
96102
<revision>${build.version}</revision>
97-
<!-- Empties build number variable.-->
103+
<!-- Empties build number variable. -->
98104
<build.number></build.number>
99105
</properties>
100106
</profile>
101107
</profiles>
102108

103-
<!-- Repositories contains links from were dependencies will be searched -->
109+
<!-- Repositories contains links from were dependencies will be searched -->
104110
<repositories>
105111
<repository>
106112
<id>spigot-repo</id>
@@ -120,7 +126,7 @@
120126
</repository>
121127
</repositories>
122128

123-
<!-- Your addon must contain Spigot and BentoBox APIs dependencies. -->
129+
<!-- Your addon must contain Spigot and BentoBox APIs dependencies. -->
124130
<dependencies>
125131
<dependency>
126132
<groupId>org.spigotmc</groupId>
@@ -135,9 +141,16 @@
135141
<version>${bentobox.version}</version>
136142
<scope>provided</scope>
137143
</dependency>
144+
145+
<dependency>
146+
<groupId>org.jetbrains</groupId>
147+
<artifactId>annotations</artifactId>
148+
<version>18.0.0</version>
149+
</dependency>
138150
</dependencies>
139151

140-
<!-- Build contains information for maven. It allows to create correct jar file. -->
152+
<!-- Build contains information for maven. It allows to create correct
153+
jar file. -->
141154
<build>
142155
<finalName>${project.name}-${revision}${build.number}</finalName>
143156

src/main/java/world/bentobox/controlpanel/ControlPanelAddon.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ public void onEnable()
103103

104104
gameModeAddon.getAdminCommand().ifPresent(
105105
adminCommand -> new AdminCommand(this, adminCommand));
106+
107+
// Load default template if there are no existing control panels
108+
if (!this.manager.hasAnyControlPanel(gameModeAddon))
109+
{
110+
this.manager.importControlPanels(null, gameModeAddon);
111+
}
106112
}
107113
});
108114
}

0 commit comments

Comments
 (0)