Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitda29af7

Browse files
authored
Adding codespaces support; Fixing checkstyle (#823)
* Adding codespaces support; Fixing checkstyle* Fixing pipeline
1 parentc812daa commitda29af7

File tree

3 files changed

+68
-29
lines changed

3 files changed

+68
-29
lines changed

‎.devcontainer/devcontainer.json‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/java
3+
{
4+
"name":"Java",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
//https://mcr.microsoft.com/v2/vscode/devcontainers/java/tags/list
7+
"image":"mcr.microsoft.com/devcontainers/java:11",
8+
"hostRequirements": {
9+
"cpus":2
10+
},
11+
"features": {
12+
"ghcr.io/devcontainers/features/java:1": {
13+
"version":"none",
14+
"installMaven":"true",
15+
"installGradle":"true"
16+
},
17+
"ghcr.io/devcontainers/features/sshd:1": {
18+
"version":"latest"
19+
},
20+
"ghcr.io/devcontainers/features/docker-in-docker:2": {
21+
"version":"latest",
22+
"dockerDashComposeVersion":"v1"
23+
}
24+
},
25+
"customizations": {
26+
"vscode": {
27+
"extensions": [
28+
"oracle.oracle-java",
29+
"vscjava.vscode-java-pack",
30+
"vscjava.vscode-java-debug",
31+
"vscjava.vscode-maven",
32+
"vscjava.vscode-gradle",
33+
"vscjava.vscode-java-dependency",
34+
"vscjava.vscode-java-test",
35+
"vscjava.vscode-spring-boot-dashboard",
36+
"vscjava.vscode-spring-initializr",
37+
"redhat.java",
38+
"vmware.vscode-boot-dev-pack",
39+
"vmware.vscode-spring-boot",
40+
"ms-azuretools.vscode-docker",
41+
"redhat.vscode-xml",
42+
"redhat.vscode-yaml",
43+
"editorconfig.editorconfig"
44+
]
45+
}
46+
}
47+
}

‎.github/workflows/build.yml‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ jobs:
55
runs-on:ubuntu-latest
66
steps:
77
-name:Checkout source code
8-
uses:actions/checkout@v1
9-
with:
10-
ref:master
8+
uses:actions/checkout@v4
119
-name:Set up JDK 11
12-
uses:actions/setup-java@v1
10+
uses:actions/setup-java@v3
1311
with:
14-
java-version:11
12+
distribution:temurin
13+
java-version:11
1514
-name:Build with Gradle
1615
run:./gradlew test checkstyleMain

‎src/main/java/ev3dev/actuators/Sound.java‎

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
packageev3dev.actuators;
22

3+
importjava.io.File;
4+
importjava.io.IOException;
5+
importjava.net.MalformedURLException;
6+
importjava.net.URL;
7+
importjava.util.Objects;
8+
9+
importjavax.sound.sampled.AudioInputStream;
10+
importjavax.sound.sampled.AudioSystem;
11+
importjavax.sound.sampled.Clip;
12+
importjavax.sound.sampled.LineUnavailableException;
13+
importjavax.sound.sampled.UnsupportedAudioFileException;
14+
15+
importorg.slf4j.Logger;
16+
importorg.slf4j.LoggerFactory;
17+
318
importev3dev.hardware.EV3DevDevice;
419
importev3dev.hardware.EV3DevDistro;
520
importev3dev.hardware.EV3DevDistros;
621
importev3dev.hardware.EV3DevPlatform;
722
importev3dev.utils.Shell;
823
importev3dev.utils.Sysfs;
924
importlejos.utility.Delay;
10-
importorg.slf4j.Logger;
11-
importorg.slf4j.LoggerFactory;
12-
13-
importjavax.sound.sampled.AudioInputStream;
14-
importjavax.sound.sampled.AudioSystem;
15-
importjavax.sound.sampled.Clip;
16-
importjavax.sound.sampled.LineUnavailableException;
17-
importjavax.sound.sampled.UnsupportedAudioFileException;
18-
importjava.io.File;
19-
importjava.io.IOException;
20-
importjava.util.Objects;
21-
importjava.net.URL;
22-
importjava.net.MalformedURLException;
2325

2426

2527
/**
@@ -119,7 +121,6 @@ public void twoBeeps() {
119121
* @param duration The duration of the tone, in milliseconds.
120122
* @param volume The volume of the playback
121123
*
122-
* @see playTone(int, int)
123124
*/
124125
publicvoidplayTone(finalintfrequency,finalintduration,finalintvolume) {
125126
if (CURRENT_PLATFORM.equals(EV3DevPlatform.EV3BRICK)) {
@@ -152,8 +153,6 @@ public void playTone(final int frequency, final int duration) {
152153
* @param url URL to the sample
153154
* @param volume the volume level
154155
*
155-
* @see playSample(URL)
156-
* @see setVolume(int)
157156
*/
158157
publicvoidplaySample(finalURLurl,finalintvolume) {
159158
this.setVolume(volume);
@@ -166,8 +165,6 @@ public void playSample(final URL url, final int volume) {
166165
* @param file File path to the sample
167166
* @param volume the volume level
168167
*
169-
* @see playSample(File)
170-
* @see setVolume(int)
171168
*/
172169
publicvoidplaySample(finalFilefile,finalintvolume) {
173170
this.setVolume(volume);
@@ -180,8 +177,6 @@ public void playSample(final File file, final int volume) {
180177
* @param resource Resource path to the sample
181178
* @param volume the volume level
182179
*
183-
* @see playSample(String)
184-
* @see setVolume(int)
185180
*/
186181
publicvoidplaySample(finalStringresource,finalintvolume) {
187182
this.setVolume(volume);
@@ -218,8 +213,7 @@ public void playSample(final URL url) {
218213
publicvoidplaySample(finalFilefile) {
219214
try {
220215
playSample(file.toURI().toURL());
221-
}
222-
catch (MalformedURLExceptione) {
216+
}catch (MalformedURLExceptione) {
223217
LOGGER.error(e.getLocalizedMessage(),e);
224218
thrownewRuntimeException(e);
225219
}
@@ -274,8 +268,7 @@ public void setVolume(final int volume) {
274268
// "Beep" (tones), so set the volume for both:
275269
finalString[]mixers = {"PCM","Beep"};
276270
for (Stringitem :mixers) {
277-
Shell.execute(newString[]
278-
{"amixer","set",item+",0",""+volume+"%"});
271+
Shell.execute(newString[] {"amixer","set",item +",0","" +volume +"%"});
279272
}
280273
}
281274
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp