1
mirror of https://github.com/CarmJos/MineConfiguration.git synced 2026-06-13 15:58:42 +08:00

Compare commits

..

5 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
carm 7820b14344 build(deps): Update with EasyConfiguration 2025-02-22 10:20:34 +08:00
carm 3a1ad7f9ce build(deps): Update repo 2025-02-20 00:37:27 +08:00
8 changed files with 44 additions and 72 deletions
+2 -48
View File
@@ -20,7 +20,7 @@ jobs:
- name: "Set up JDK" - name: "Set up JDK"
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
java-version: '11' java-version: '17'
distribution: 'adopt' distribution: 'adopt'
cache: maven cache: maven
server-id: github server-id: github
@@ -29,59 +29,13 @@ jobs:
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import 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 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 run: mvn -B -Pgithub deploy --file pom.xml -DskipTests
env: env:
MAVEN_USERNAME: ${{ github.repository_owner }} MAVEN_USERNAME: ${{ github.repository_owner }}
MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}} MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} 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: central-deploy:
name: "Deploy Project (Central Repository)" name: "Deploy Project (Central Repository)"
runs-on: ubuntu-latest runs-on: ubuntu-latest
+1 -1
View File
@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>mineconfiguration-parent</artifactId> <artifactId>mineconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId> <groupId>cc.carm.lib</groupId>
<version>3.0.0</version> <version>3.0.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<properties> <properties>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>mineconfiguration-parent</artifactId> <artifactId>mineconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId> <groupId>cc.carm.lib</groupId>
<version>3.0.0</version> <version>3.0.2</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@@ -6,7 +6,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.UnmodifiableView; import org.jetbrains.annotations.UnmodifiableView;
import java.util.List; import java.util.Collections;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@@ -14,12 +14,14 @@ public class BukkitSection implements ConfigureSection {
protected final @NotNull BukkitSource source; protected final @NotNull BukkitSource source;
protected final @Nullable BukkitSection parent; protected final @Nullable BukkitSection parent;
protected final @NotNull String path;
protected final @NotNull ConfigurationSection data; protected final @NotNull ConfigurationSection data;
public BukkitSection(@NotNull BukkitSource source, @Nullable BukkitSection parent, public BukkitSection(@NotNull BukkitSource source, @Nullable BukkitSection parent,
@NotNull ConfigurationSection data) { @NotNull String path, @NotNull ConfigurationSection data) {
this.source = source; this.source = source;
this.parent = parent; this.parent = parent;
this.path = path;
this.data = data; this.data = data;
} }
@@ -32,6 +34,11 @@ public class BukkitSection implements ConfigureSection {
return this.parent; return this.parent;
} }
@Override
public @NotNull String path() {
return this.path;
}
public @NotNull ConfigurationSection data() { public @NotNull ConfigurationSection data() {
return this.data; return this.data;
} }
@@ -43,11 +50,23 @@ public class BukkitSection implements ConfigureSection {
@Override @Override
public @NotNull @UnmodifiableView Map<String, Object> getValues(boolean deep) { 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 @Override
public void set(@NotNull String path, @Nullable Object value) { public void set(@NotNull String path, @Nullable Object value) {
if (value instanceof BukkitSection) { // unwrap
value = ((BukkitSection) value).data();
}
data().set(path, value); data().set(path, value);
} }
@@ -56,16 +75,6 @@ public class BukkitSection implements ConfigureSection {
data().set(path, null); data().set(path, null);
} }
@Override
public boolean contains(@NotNull String path) {
return data().contains(path);
}
@Override
public @Nullable List<?> getList(@NotNull String path) {
return data().getList(path);
}
@Override @Override
public @Nullable ConfigureSection getSection(@NotNull String path) { public @Nullable ConfigureSection getSection(@NotNull String path) {
Object value = get(path); Object value = get(path);
@@ -75,11 +84,20 @@ public class BukkitSection implements ConfigureSection {
return null; return null;
} }
public @NotNull BukkitSection createSection(@NotNull String path, @NotNull ConfigurationSection section) {
return new BukkitSection(source(), this, path, section);
}
@Override
public @NotNull BukkitSection createSection(@NotNull String path, @NotNull Map<?, ?> data) {
return createSection(path, data().createSection(path, data));
}
@Override @Override
public @Nullable Object get(@NotNull String path) { public @Nullable Object get(@NotNull String path) {
Object value = data().get(path); Object value = data().get(path);
if (value instanceof ConfigurationSection) { if (value instanceof ConfigurationSection) { // wrap
return new BukkitSection(source(), this, (ConfigurationSection) value); return createSection(path, (ConfigurationSection) value);
} }
return value; return value;
} }
@@ -38,7 +38,7 @@ public class BukkitSource extends FileConfigSource<BukkitSection, YamlConfigurat
} }
@Override @Override
protected BukkitSource self() { protected @NotNull BukkitSource self() {
return this; return this;
} }
@@ -68,7 +68,7 @@ public class BukkitSource extends FileConfigSource<BukkitSection, YamlConfigurat
@Override @Override
protected void onReload() throws Exception { protected void onReload() throws Exception {
YamlConfiguration configuration = fileReader(YamlConfiguration::loadConfiguration); YamlConfiguration configuration = fileReader(YamlConfiguration::loadConfiguration);
this.rootSection = new BukkitSection(this, null, configuration); this.rootSection = new BukkitSection(this, null, "", configuration);
} }
@Override @Override
+1 -1
View File
@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>mineconfiguration-parent</artifactId> <artifactId>mineconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId> <groupId>cc.carm.lib</groupId>
<version>3.0.0</version> <version>3.0.2</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>mineconfiguration-parent</artifactId> <artifactId>mineconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId> <groupId>cc.carm.lib</groupId>
<version>3.0.0</version> <version>3.0.2</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
+3 -3
View File
@@ -10,14 +10,14 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding> <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<deps.easyconfifuration.version>4.0.2</deps.easyconfifuration.version> <deps.easyconfifuration.version>4.0.7</deps.easyconfifuration.version>
<deps.yamlcommentwriter.version>1.2.0</deps.yamlcommentwriter.version> <deps.yamlcommentwriter.version>1.2.0</deps.yamlcommentwriter.version>
<deps.easyplugin.version>1.5.12</deps.easyplugin.version> <deps.easyplugin.version>1.5.12</deps.easyplugin.version>
</properties> </properties>
<groupId>cc.carm.lib</groupId> <groupId>cc.carm.lib</groupId>
<artifactId>mineconfiguration-parent</artifactId> <artifactId>mineconfiguration-parent</artifactId>
<version>3.0.0</version> <version>3.0.2</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<modules> <modules>
<module>common</module> <module>common</module>
@@ -167,7 +167,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version> <version>3.14.0</version>
<configuration> <configuration>
<source>${project.jdk.version}</source> <source>${project.jdk.version}</source>
<target>${project.jdk.version}</target> <target>${project.jdk.version}</target>