Skip to content

Commit

Permalink
fix: writing big archives, attach sources
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkAtra committed Dec 17, 2021
1 parent 0135c2a commit 4a34b52
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions big/src/main/kotlin/de/darkatra/bfme2/big/BigArchive.kt
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ class BigArchive(
private fun writeFileContent(output: OutputStream) {
entries.forEach { entry ->
output.write(entry.inputStream().use { it.readAllBytes() })
entry.pendingOutputStream.reset()
entry.hasPendingChanges = false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ internal class BigArchiveEntryOutputStream(
override fun flush() {
bigArchiveEntry.hasPendingChanges = true
bigArchiveEntry.size = outputStream.size().toUInt()
outputStream.reset()
}
}
16 changes: 14 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@
</dependencyManagement>

<build>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<sourceDirectory>src/main/kotlin</sourceDirectory>
<testSourceDirectory>src/test/kotlin</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
Expand Down Expand Up @@ -149,6 +149,18 @@
</args>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
Expand Down

0 comments on commit 4a34b52

Please sign in to comment.