1
mirror of https://github.com/CarmJos/MineConfiguration.git synced 2026-06-05 06:51:49 +08:00

Compare commits

...

3 Commits

Author SHA1 Message Date
carm adf26baf59 ci(deploy): Cancel javadoc deployment 2025-02-25 01:44:28 +08:00
carm 3d814baa8f build(deps): Update with EasyConfiguration 2025-02-25 01:43:30 +08:00
dependabot[bot] c5c93d836f chore(deps): bump org.apache.maven.plugins:maven-compiler-plugin
Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.13.0 to 3.14.0.
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.13.0...maven-compiler-plugin-3.14.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-compiler-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-22 10:21:42 +08:00
8 changed files with 38 additions and 67 deletions
+1 -47
View File
@@ -29,59 +29,13 @@ jobs:
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: "Maven Deploy With Javadoc"
- name: "Maven Deploy"
run: mvn -B -Pgithub deploy --file pom.xml -DskipTests
env:
MAVEN_USERNAME: ${{ github.repository_owner }}
MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: "Copy Javadoc to Location"
run: |
rm -rf docs
mkdir -vp docs
cp -vrf core/target/reports/apidocs/* docs/
cp -vrf .doc/JAVADOC-README.md docs/README.md
- name: "Generate the Javadoc sitemap"
id: sitemap
uses: cicirello/generate-sitemap@v1
with:
base-url-path: https://CarmJos.github.io/EasyConfiguration
path-to-root: docs
- name: "Output stats"
run: |
echo "sitemap-path = ${{ steps.sitemap.outputs.sitemap-path }}"
echo "url-count = ${{ steps.sitemap.outputs.url-count }}"
echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}"
- name: "Configure Git"
env:
DEPLOY_PRI: ${{secrets.DEPLOY_PRI}}
run: |
sudo timedatectl set-timezone "Asia/Shanghai"
mkdir -p ~/.ssh/
echo "$DEPLOY_PRI" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
git config --global user.name 'CarmJos'
git config --global user.email 'carm@carm.cc'
- name: "Commit documentations"
run: |
cd docs
git init
git remote add origin git@github.com:CarmJos/EasyConfiguration.git
git checkout -b gh-pages
git add -A
git commit -m "API Document generated."
- name: "Push javadocs"
run: |
cd docs
git push origin HEAD:gh-pages --force
central-deploy:
name: "Deploy Project (Central Repository)"
runs-on: ubuntu-latest
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>mineconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>3.0.1</version>
<version>3.0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>mineconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>3.0.1</version>
<version>3.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -6,6 +6,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.UnmodifiableView;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
@@ -13,12 +14,14 @@ public class BukkitSection implements ConfigureSection {
protected final @NotNull BukkitSource source;
protected final @Nullable BukkitSection parent;
protected final @NotNull String path;
protected final @NotNull ConfigurationSection data;
public BukkitSection(@NotNull BukkitSource source, @Nullable BukkitSection parent,
@NotNull ConfigurationSection data) {
@NotNull String path, @NotNull ConfigurationSection data) {
this.source = source;
this.parent = parent;
this.path = path;
this.data = data;
}
@@ -31,6 +34,11 @@ public class BukkitSection implements ConfigureSection {
return this.parent;
}
@Override
public @NotNull String path() {
return this.path;
}
public @NotNull ConfigurationSection data() {
return this.data;
}
@@ -42,11 +50,23 @@ public class BukkitSection implements ConfigureSection {
@Override
public @NotNull @UnmodifiableView Map<String, Object> getValues(boolean deep) {
return data().getValues(deep);
Map<String, Object> original = data().getValues(deep);
// wrap all ConfigurationSection
for (Map.Entry<String, Object> entry : original.entrySet()) {
if (entry.getValue() instanceof ConfigurationSection) {
original.put(entry.getKey(), createSection(entry.getKey(), (ConfigurationSection) entry.getValue()));
}
}
return Collections.unmodifiableMap(original);
}
@Override
public void set(@NotNull String path, @Nullable Object value) {
if (value instanceof BukkitSection) { // unwrap
value = ((BukkitSection) value).data();
}
data().set(path, value);
}
@@ -60,27 +80,24 @@ public class BukkitSection implements ConfigureSection {
Object value = get(path);
if (value instanceof ConfigureSection) {
return (ConfigureSection) value;
} else if (value instanceof ConfigurationSection) {
return new BukkitSection(source(), this, (ConfigurationSection) value);
}
return null;
}
@Override
public @NotNull ConfigureSection createSection(@NotNull Map<?, ?> data) {
throw new UnsupportedOperationException("BukkitSection does not support this operation");
public @NotNull BukkitSection createSection(@NotNull String path, @NotNull ConfigurationSection section) {
return new BukkitSection(source(), this, path, section);
}
@Override
public @NotNull ConfigureSection computeSection(@NotNull String path) {
return new BukkitSection(source(), this, data.createSection(path));
public @NotNull BukkitSection createSection(@NotNull String path, @NotNull Map<?, ?> data) {
return createSection(path, data().createSection(path, data));
}
@Override
public @Nullable Object get(@NotNull String path) {
Object value = data().get(path);
if (value instanceof ConfigurationSection) {
return new BukkitSection(source(), this, (ConfigurationSection) value);
if (value instanceof ConfigurationSection) { // wrap
return createSection(path, (ConfigurationSection) value);
}
return value;
}
@@ -38,7 +38,7 @@ public class BukkitSource extends FileConfigSource<BukkitSection, YamlConfigurat
}
@Override
protected BukkitSource self() {
protected @NotNull BukkitSource self() {
return this;
}
@@ -68,7 +68,7 @@ public class BukkitSource extends FileConfigSource<BukkitSection, YamlConfigurat
@Override
protected void onReload() throws Exception {
YamlConfiguration configuration = fileReader(YamlConfiguration::loadConfiguration);
this.rootSection = new BukkitSection(this, null, configuration);
this.rootSection = new BukkitSection(this, null, "", configuration);
}
@Override
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>mineconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>3.0.1</version>
<version>3.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>mineconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>3.0.1</version>
<version>3.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
+3 -3
View File
@@ -10,14 +10,14 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<deps.easyconfifuration.version>4.0.6</deps.easyconfifuration.version>
<deps.easyconfifuration.version>4.0.7</deps.easyconfifuration.version>
<deps.yamlcommentwriter.version>1.2.0</deps.yamlcommentwriter.version>
<deps.easyplugin.version>1.5.12</deps.easyplugin.version>
</properties>
<groupId>cc.carm.lib</groupId>
<artifactId>mineconfiguration-parent</artifactId>
<version>3.0.1</version>
<version>3.0.2</version>
<packaging>pom</packaging>
<modules>
<module>common</module>
@@ -167,7 +167,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<version>3.14.0</version>
<configuration>
<source>${project.jdk.version}</source>
<target>${project.jdk.version}</target>