Skip to content

Commit

Permalink
Fix access denied and SSL issues (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneLamoureux committed Nov 30, 2023
1 parent 576d05c commit 64a06e7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# SC Trade Companion
## 0.2.1
### Bugs
- Fix data not being exported to the /my-data folder
- Fix data not being published to https://sc-trade.tools

## 0.2.0
### Features
- #8 Add a sound when a screenshot is taken
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = 'tools.sctrade'
version = '0.2.0'
version = '0.2.1'

java {
sourceCompatibility = '17'
Expand Down Expand Up @@ -67,7 +67,7 @@ task jdeps(dependsOn: 'copyDependencies') {
doLast {
exec {
def jdeps = new ByteArrayOutputStream()
commandLine 'jdeps', '--class-path', '"build/dependencies/*"', '--multi-release', 'base', '--ignore-missing-deps', '-recursive', '--print-module-deps', "$buildDir/libs/${rootProject.name}-${version}.jar"
commandLine 'jdeps', '--class-path', '"build/dependencies/*"', '--multi-release', 'base', '--ignore-missing-deps', '-recursive', '--print-module-deps', "$buildDir/libs/${rootProject.name}-${version}.jar" // TODO append jdk.crypto.ec
standardOutput = jdeps
ext.jdeps = jdeps
}
Expand All @@ -78,7 +78,7 @@ task jlink(dependsOn: 'jdeps') {
doLast {
exec {
workingDir = projectDir
commandLine 'jlink', '--output', "$binariesDir/jre", '--add-modules', 'java.base,java.compiler,java.desktop,java.instrument,java.management,java.naming,java.net.http,java.prefs,java.scripting,java.sql,jdk.jfr,jdk.unsupported' // TODO use "${tasks.jdeps.jdeps}"
commandLine 'jlink', '--output', "$binariesDir/jre", '--add-modules', 'java.base,java.compiler,java.desktop,java.instrument,java.management,java.naming,java.net.http,java.prefs,java.scripting,java.sql,jdk.jfr,jdk.unsupported,jdk.crypto.ec' // TODO use "${tasks.jdeps.jdeps}"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package tools.sctrade.companion.output.commodity;

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
Expand Down Expand Up @@ -35,7 +34,6 @@ public void process(CommoditySubmission submission) {
try {
logger.debug("Writing {} commodity listings to '{}'...", submission.getListings().size(),
filePath);
Files.createDirectories(filePath);
Collection<List<String>> lines = buildLines(submission);
CsvUtil.write(filePath, lines);
logger.info("Wrote {} commodity listings to '{}'", submission.getListings().size(), filePath);
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/tools/sctrade/companion/utils/CsvUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.Collection;
Expand All @@ -24,7 +25,9 @@
public class CsvUtil {
private CsvUtil() {}

public static void write(Path path, Collection<List<String>> lines) {
public static void write(Path path, Collection<List<String>> lines) throws IOException {
Files.createDirectories(path.getParent());

try (CSVWriter writer = new CSVWriter(new FileWriter(path.toString(), true))) {
for (List<String> line : lines) {
writer.writeNext(line.toArray(new String[0]));
Expand Down

0 comments on commit 64a06e7

Please sign in to comment.