Skip to content

Commit 061f08c

Browse files
committed
nna-
1 parent 381613c commit 061f08c

File tree

6 files changed

+372
-8
lines changed

6 files changed

+372
-8
lines changed

.github/workflows/builder.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Java CI with Gradle
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up JDK 8
16+
uses: actions/setup-java@v1
17+
with:
18+
java-version: 8
19+
- name: Grant execute permission for gradlew
20+
run: chmod +x gradlew
21+
- name: Build with Gradle
22+
run: ./gradlew build publish --stacktrace --no-daemon
23+
env:
24+
signingkey: ${{secrets.SIGNING_KEY}}
25+
signingkeyid: ${{secrets.SIGNING_KEYID}}
26+
signingpassword: ${{secrets.SIGNING_PASSWORD}}
27+
sonatypepassword: ${{secrets.SONATYPE_PASSWORD}}
28+
sonatypeusername: ${{secrets.SONATYPE_USERNAME}}
29+
- name: Zip create
30+
run: |
31+
cd build/libs
32+
zip release *.*
33+
- name: Upload artifact
34+
uses: actions/upload-artifact@v1
35+
with:
36+
name: FNJL-Release
37+
path: build/libs
38+
- name: Create Release
39+
id: create_release
40+
uses: actions/create-release@v1
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}
43+
with:
44+
tag_name: ${{ github.ref }}
45+
release_name: BetterTaskbar - ${{ github.ref }}
46+
body: |
47+
The New Release!
48+
Build by ${{ github.actor }}
49+
draft: false
50+
prerelease: false
51+
- name: Upload Release Asset
52+
id: upload-release-asset
53+
uses: actions/[email protected]
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}
56+
with:
57+
upload_url: ${{ steps.create_release.outputs.upload_url }}
58+
asset_path: ./build/libs/release.zip
59+
asset_name: FelNullJavaLibrary.zip
60+
asset_content_type: application/zip

.gitignore

Lines changed: 150 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# Mobile Tools for Java (J2ME)
1212
.mtj.tmp/
13-
13+
secring.gpg
1414
# Package Files #
1515
*.jar
1616
*.war
@@ -147,3 +147,152 @@ $RECYCLE.BIN/
147147
# Windows shortcuts
148148
*.lnk
149149

150+
### Java template
151+
# Compiled class file
152+
*.class
153+
154+
# Log file
155+
*.log
156+
157+
# BlueJ files
158+
*.ctxt
159+
160+
# Mobile Tools for Java (J2ME)
161+
.mtj.tmp/
162+
163+
# Package Files #
164+
*.jar
165+
*.war
166+
*.nar
167+
*.ear
168+
*.zip
169+
*.tar.gz
170+
*.rar
171+
172+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
173+
hs_err_pid*
174+
175+
### JetBrains template
176+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
177+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
178+
179+
# User-specific stuff
180+
.idea/**/workspace.xml
181+
.idea/**/tasks.xml
182+
.idea/**/usage.statistics.xml
183+
.idea/**/dictionaries
184+
.idea/**/shelf
185+
186+
# Generated files
187+
.idea/**/contentModel.xml
188+
189+
# Sensitive or high-churn files
190+
.idea/**/dataSources/
191+
.idea/**/dataSources.ids
192+
.idea/**/dataSources.local.xml
193+
.idea/**/sqlDataSources.xml
194+
.idea/**/dynamic.xml
195+
.idea/**/uiDesigner.xml
196+
.idea/**/dbnavigator.xml
197+
198+
# Gradle
199+
.idea/**/gradle.xml
200+
.idea/**/libraries
201+
202+
# Gradle and Maven with auto-import
203+
# When using Gradle or Maven with auto-import, you should exclude module files,
204+
# since they will be recreated, and may cause churn. Uncomment if using
205+
# auto-import.
206+
# .idea/artifacts
207+
# .idea/compiler.xml
208+
# .idea/jarRepositories.xml
209+
# .idea/modules.xml
210+
# .idea/*.iml
211+
# .idea/modules
212+
# *.iml
213+
# *.ipr
214+
215+
# CMake
216+
cmake-build-*/
217+
218+
# Mongo Explorer plugin
219+
.idea/**/mongoSettings.xml
220+
221+
# File-based project format
222+
*.iws
223+
224+
# IntelliJ
225+
out/
226+
227+
# mpeltonen/sbt-idea plugin
228+
.idea_modules/
229+
230+
# JIRA plugin
231+
atlassian-ide-plugin.xml
232+
233+
# Cursive Clojure plugin
234+
.idea/replstate.xml
235+
236+
# Crashlytics plugin (for Android Studio and IntelliJ)
237+
com_crashlytics_export_strings.xml
238+
crashlytics.properties
239+
crashlytics-build.properties
240+
fabric.properties
241+
242+
# Editor-based Rest Client
243+
.idea/httpRequests
244+
245+
# Android studio 3.1+ serialized cache file
246+
.idea/caches/build_file_checksums.ser
247+
248+
### Example user template template
249+
### Example user template
250+
251+
# IntelliJ project files
252+
.idea
253+
*.iml
254+
out
255+
gen
256+
### Gradle template
257+
.gradle
258+
**/build/
259+
!src/**/build/
260+
261+
# Ignore Gradle GUI config
262+
gradle-app.setting
263+
264+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
265+
!gradle-wrapper.jar
266+
267+
# Cache of project
268+
.gradletasknamecache
269+
270+
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
271+
# gradle/wrapper/gradle-wrapper.properties
272+
273+
### Windows template
274+
# Windows thumbnail cache files
275+
Thumbs.db
276+
Thumbs.db:encryptable
277+
ehthumbs.db
278+
ehthumbs_vista.db
279+
280+
# Dump file
281+
*.stackdump
282+
283+
# Folder config file
284+
[Dd]esktop.ini
285+
286+
# Recycle Bin used on file shares
287+
$RECYCLE.BIN/
288+
289+
# Windows Installer files
290+
*.cab
291+
*.msi
292+
*.msix
293+
*.msm
294+
*.msp
295+
296+
# Windows shortcuts
297+
*.lnk
298+

common/build.gradle

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
plugins {
22
id 'java'
3+
id 'maven-publish'
4+
id 'signing'
35
}
46
group rootProject.group
57
archivesBaseName = rootProject.archivesBaseName
@@ -11,5 +13,79 @@ repositories {
1113
dependencies {
1214
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
1315
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
16+
}
17+
18+
test {
19+
useJUnitPlatform()
20+
}
21+
22+
java {
23+
withJavadocJar()
24+
withSourcesJar()
25+
}
26+
27+
publishing {
28+
publications {
29+
mavenJava(MavenPublication) {
30+
artifactId = archivesBaseName
31+
from components.java
32+
pom {
33+
name = 'FelNullJavaLibrary'
34+
description = 'Java integrated library used by FelNull'
35+
url = 'https://github.com/TeamFelnull/'
36+
licenses {
37+
license {
38+
name = 'GNU Lesser General Public License v3.0'
39+
url = 'https://www.gnu.org/licenses/lgpl-3.0.txt'
40+
}
41+
}
42+
developers {
43+
developer {
44+
id = 'FelNull'
45+
name = 'TeamFelNull'
46+
47+
}
48+
developer {
49+
id = 'MORIMORI0317'
50+
name = 'MORIMORI0317'
51+
}
52+
}
53+
scm {
54+
connection = '[email protected]:TeamFelnull/FelNullJavaLibrary.git'
55+
developerConnection = '[email protected]:TeamFelnull/FelNullJavaLibrary.git'
56+
url = 'https://github.com/TeamFelnull/FelNullJavaLibrary'
57+
}
58+
}
59+
}
60+
}
61+
repositories {
62+
maven {
63+
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2"
64+
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots"
65+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
66+
credentials {
67+
username = System.getenv('sonatypeusername')
68+
password = System.getenv('sonatypepassword')
69+
}
70+
}
71+
}
72+
}
73+
74+
signing {
75+
sign publishing.publications.mavenJava
76+
def signingKeyId = System.getenv('signingkeyid')
77+
def signingKey = System.getenv('signingkey')
78+
def signingPassword = System.getenv('signingpassword')
79+
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
80+
}
1481

82+
javadoc {
83+
if (JavaVersion.current().isJava9Compatible()) {
84+
options.addBooleanOption('html5', true)
85+
}
86+
options.charSet = 'UTF-8'
87+
options.encoding = 'UTF-8'
1588
}
89+
90+
91+

common/src/main/java/dev/felnull/fnjl/util/FNDataUtil.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,17 @@ public static byte[] fileLoadToProgress(File file, Consumer<ProgressWriter.Write
182182
return loadToProgress(new FileInputStream(file), file.length(), progress);
183183
}
184184

185+
/**
186+
* リソースフォルダからデータを抽出
187+
*
188+
* @param targetClass リソースフォルダのクラス
189+
* @param path リソースパス
190+
* @return InputStream
191+
*/
192+
public static InputStream resourceExtractor(Class<?> targetClass, String path) {
193+
InputStream stream = targetClass.getResourceAsStream("/" + path);
194+
if (stream == null)
195+
stream = ClassLoader.getSystemResourceAsStream(path);
196+
return stream != null ? new BufferedInputStream(stream) : null;
197+
}
185198
}

0 commit comments

Comments
 (0)