Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
Ran the code through Spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
DeflatedPickle committed Feb 9, 2021
1 parent 85a5e68 commit 44886b3
Show file tree
Hide file tree
Showing 27 changed files with 100 additions and 73 deletions.
3 changes: 1 addition & 2 deletions core/src/main/kotlin/com/deflatedpickle/quiver/Quiver.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/* Copyright (c) 2020 DeflatedPickle under the MIT license */
/* Copyright (c) 2020-2021 DeflatedPickle under the MIT license */

package com.deflatedpickle.quiver

import com.deflatedpickle.haruhi.api.plugin.Plugin
import com.deflatedpickle.haruhi.api.plugin.PluginType
import com.deflatedpickle.quiver.backend.event.EventNewDocument
import com.deflatedpickle.quiver.backend.event.EventSearchFolder
import com.deflatedpickle.quiver.backend.event.EventSelectFile
import com.deflatedpickle.quiver.backend.event.EventSelectFolder
import java.io.File
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* Copyright (c) 2021 DeflatedPickle under the MIT license */

package com.deflatedpickle.quiver.backend.api.exceptions

class UnsupportedPackVersion(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/* Copyright (c) 2021 DeflatedPickle under the MIT license */

package com.deflatedpickle.quiver.backend.extension

import com.deflatedpickle.quiver.backend.util.Filters
import com.deflatedpickle.marvin.util.OSUtil
import com.deflatedpickle.quiver.backend.util.Filters
import so.madprogrammer.PatternFilter

fun OSUtil.OS.toPatternFilter(): PatternFilter = if (this == OSUtil.OS.WINDOWS) {
Filters.PATH_WINDOWS
} else {
Filters.PATH_UNIX
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

package com.deflatedpickle.quiver.frontend.extension

import java.awt.Component
import javax.swing.Icon
import javax.swing.JToolBar
import org.jdesktop.swingx.JXButton
import javax.swing.Icon

fun JToolBar.add(text: String, action: () -> Unit): JXButton =
JXButton(text).apply {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
/* Copyright (c) 2021 DeflatedPickle under the MIT license */

package com.deflatedpickle.quiver.frontend.widget

import com.deflatedpickle.nagato.NagatoIcon
import java.util.regex.Pattern
import javax.swing.JToggleButton
import javax.swing.JToolBar
import org.jdesktop.swingx.JXSearchField
import org.jdesktop.swingx.search.Searchable
import java.util.regex.Pattern
import javax.swing.*

class SearchToolbar(
private val searchable: Searchable
Expand Down Expand Up @@ -72,4 +75,4 @@ class SearchToolbar(
-1,
this.backwardsCheckbox.isSelected
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ import com.deflatedpickle.rawky.ui.constraints.StickWest
import java.awt.BorderLayout
import java.awt.Desktop
import java.awt.GridBagLayout
import javax.swing.BorderFactory
import javax.swing.JComponent
import javax.swing.JPopupMenu
import javax.swing.JSeparator
import javax.swing.SwingConstants
import org.jdesktop.swingx.JXButton
import org.jdesktop.swingx.JXLabel
import org.jdesktop.swingx.JXPanel
import org.jdesktop.swingx.JXTextField
import javax.swing.*

object FilePanel : PluginPanel() {
private val nameLabel = JXLabel("Name")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import com.deflatedpickle.haruhi.util.PluginUtil
import com.deflatedpickle.nagato.NagatoIcon
import com.deflatedpickle.quiver.Quiver
import com.deflatedpickle.quiver.backend.event.EventReplaceFile
import com.deflatedpickle.quiver.filepanel.FilePanelPlugin
import java.awt.datatransfer.DataFlavor
import java.awt.dnd.DnDConstants
import java.awt.dnd.DropTarget
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
package com.deflatedpickle.quiver.filetable

import com.deflatedpickle.haruhi.component.PluginPanel
import com.deflatedpickle.rawky.ui.constraints.FillBothFinishLine
import java.awt.BorderLayout
import java.awt.GridBagLayout
import javax.swing.JScrollPane

object Component : PluginPanel() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
package com.deflatedpickle.quiver.foldertree

import com.deflatedpickle.haruhi.component.PluginPanel
import com.deflatedpickle.rawky.ui.constraints.FillBothFinishLine
import java.awt.BorderLayout
import java.awt.GridBagLayout
import javax.swing.JScrollPane

object Component : PluginPanel() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package com.deflatedpickle.quiver.foldertree

import com.deflatedpickle.haruhi.api.plugin.Plugin
import com.deflatedpickle.haruhi.api.plugin.PluginType
import com.deflatedpickle.haruhi.event.EventCreatePluginComponent
import com.deflatedpickle.haruhi.event.EventProgramFinishSetup
import com.deflatedpickle.quiver.Quiver
import com.deflatedpickle.quiver.backend.event.EventNewDocument
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import com.deflatedpickle.marvin.util.OSUtil
import com.deflatedpickle.quiver.launcher.window.Toolbar
import com.deflatedpickle.quiver.launcher.window.Window
import com.deflatedpickle.quiver.launcher.window.menu.MenuBar
import com.deflatedpickle.tosuto.ToastItem
import java.awt.BorderLayout
import java.awt.Dimension
import java.io.File
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
/* Copyright (c) 2021 DeflatedPickle under the MIT license */

package com.deflatedpickle.quiver.packexport

import com.deflatedpickle.haruhi.api.Registry
import com.deflatedpickle.haruhi.util.PluginUtil
import com.deflatedpickle.haruhi.util.RegistryUtil
import com.deflatedpickle.marvin.Slug
import com.deflatedpickle.marvin.extensions.toInt
import com.deflatedpickle.marvin.util.OSUtil
import com.deflatedpickle.quiver.backend.extension.toPatternFilter
import com.deflatedpickle.quiver.backend.util.DotMinecraft
import com.deflatedpickle.quiver.frontend.widget.ButtonField
import com.deflatedpickle.quiver.packexport.api.ExportStep
import com.deflatedpickle.quiver.packexport.api.ExportStepType
import com.deflatedpickle.rawky.ui.constraints.FillBothFinishLine
import com.deflatedpickle.rawky.ui.constraints.FillHorizontalFinishLine
import com.deflatedpickle.rawky.ui.constraints.StickEast
Expand Down Expand Up @@ -118,4 +117,4 @@ class ExportPackDialog : TaskDialog(PluginUtil.window, "Export Pack") {
border = BorderFactory.createEmptyBorder()
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* Copyright (c) 2021 DeflatedPickle under the MIT license */

package com.deflatedpickle.quiver.packexport

import com.deflatedpickle.haruhi.api.Registry
Expand All @@ -18,7 +20,6 @@ import com.deflatedpickle.quiver.packexport.api.PerFileExportStep
import com.deflatedpickle.quiver.packexport.event.EventExportFile
import com.deflatedpickle.quiver.packexport.event.EventFinishExportStep
import com.deflatedpickle.quiver.packexport.event.EventStartingExportStep
import java.io.File
import java.nio.file.Files
import java.util.Comparator
import javax.swing.JMenu
Expand Down Expand Up @@ -207,4 +208,4 @@ object PackExportPlugin {

progressMonitor.setProgress(++progress)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/* Copyright (c) 2021 DeflatedPickle under the MIT license */

package com.deflatedpickle.quiver.packexport.api

/**
* A step during exporting that is run on the pack as a whole
*/
abstract class BulkExportStep : ExportStep {
override fun toString(): String = "BulkExportStep( ${getSlug()}: ${getType()} )"
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* Copyright (c) 2021 DeflatedPickle under the MIT license */

package com.deflatedpickle.quiver.packexport.api

import com.deflatedpickle.marvin.Slug
Expand Down Expand Up @@ -33,4 +35,4 @@ interface ExportStep {
* This explains how the file is manipulated by this step
*/
fun processFile(file: File, progressMonitor: ProgressMonitor)
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* Copyright (c) 2021 DeflatedPickle under the MIT license */

package com.deflatedpickle.quiver.packexport.api

enum class ExportStepType {
Expand All @@ -10,4 +12,4 @@ enum class ExportStepType {
* This step packages the pack as a zip
*/
ZIPPER
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* Copyright (c) 2021 DeflatedPickle under the MIT license */

package com.deflatedpickle.quiver.packexport.api

/**
Expand All @@ -15,4 +17,4 @@ abstract class PerFileExportStep(
val affectedExtensions: Collection<String>
) : ExportStep {
override fun toString(): String = "PerFileExportStep( ${getSlug()}: ${getType()}; $affectedExtensions )"
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* Copyright (c) 2021 DeflatedPickle under the MIT license */

package com.deflatedpickle.quiver.packexport.event

import com.deflatedpickle.haruhi.api.event.AbstractEvent
Expand All @@ -6,4 +8,4 @@ import java.io.File
/**
* An event that is run when a file has been exported
*/
object EventExportFile : AbstractEvent<File>()
object EventExportFile : AbstractEvent<File>()
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* Copyright (c) 2021 DeflatedPickle under the MIT license */

package com.deflatedpickle.quiver.packexport.event

import com.deflatedpickle.haruhi.api.event.AbstractEvent
import com.deflatedpickle.quiver.packexport.api.ExportStep

object EventFinishExportStep : AbstractEvent<ExportStep>()
object EventFinishExportStep : AbstractEvent<ExportStep>()
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* Copyright (c) 2021 DeflatedPickle under the MIT license */

package com.deflatedpickle.quiver.packexport.event

import com.deflatedpickle.haruhi.api.event.AbstractEvent
import com.deflatedpickle.quiver.packexport.api.ExportStep

object EventStartingExportStep : AbstractEvent<ExportStep>()
object EventStartingExportStep : AbstractEvent<ExportStep>()
72 changes: 36 additions & 36 deletions packsquashstep/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,70 +3,70 @@ version '1.0.0'
sourceCompatibility = '1.8'

dependencies {
implementation project(':core')
implementation project(':packexport')
implementation project(':core')
implementation project(':packexport')
}

def packSquashDir = toolDir.toPath().resolve('packsquash').toFile()

task downloadLicense(type: Download) {
src 'https://raw.githubusercontent.com/ComunidadAylas/PackSquash/master/LICENSE'
//noinspection GroovyAssignabilityCheck
dest new File(packSquashDir, 'LICENSE')
overwrite false
src 'https://raw.githubusercontent.com/ComunidadAylas/PackSquash/master/LICENSE'
//noinspection GroovyAssignabilityCheck
dest new File(packSquashDir, 'LICENSE')
overwrite false
}

task downloadLinux(type: Download) {
src "https://github.com/ComunidadAylas/PackSquash/releases/download/$packSquashVersion/PackSquash.executable.Linux.zip"
dest new File(buildDir, 'PackSquash.executable.Linux.zip')
overwrite false
src "https://github.com/ComunidadAylas/PackSquash/releases/download/$packSquashVersion/PackSquash.executable.Linux.zip"
dest new File(buildDir, 'PackSquash.executable.Linux.zip')
overwrite false
}

task downloadMacOS(type: Download) {
src "https://github.com/ComunidadAylas/PackSquash/releases/download/$packSquashVersion/PackSquash.executable.macOS.zip"
dest new File(buildDir, 'PackSquash.executable.macOS.zip')
overwrite false
src "https://github.com/ComunidadAylas/PackSquash/releases/download/$packSquashVersion/PackSquash.executable.macOS.zip"
dest new File(buildDir, 'PackSquash.executable.macOS.zip')
overwrite false
}

task downloadWin(type: Download) {
src "https://github.com/ComunidadAylas/PackSquash/releases/download/$packSquashVersion/PackSquash.executable.Windows.zip"
dest new File(buildDir, 'PackSquash.executable.Windows.zip')
overwrite false
src "https://github.com/ComunidadAylas/PackSquash/releases/download/$packSquashVersion/PackSquash.executable.Windows.zip"
dest new File(buildDir, 'PackSquash.executable.Windows.zip')
overwrite false
}

task unzipLinux(dependsOn: downloadLinux, type: Copy) {
from zipTree(downloadLinux.dest)
into packSquashDir
rename('packsquash', 'packsquash-linux')
from zipTree(downloadLinux.dest)
into packSquashDir
rename('packsquash', 'packsquash-linux')
}

task unzipMacOS(dependsOn: downloadMacOS, type: Copy) {
from zipTree(downloadMacOS.dest)
into packSquashDir
rename('packsquash', 'packsquash-macos')
from zipTree(downloadMacOS.dest)
into packSquashDir
rename('packsquash', 'packsquash-macos')
}

task unzipWin(dependsOn: downloadWin, type: Copy) {
from zipTree(downloadWin.dest)
into packSquashDir
rename('packsquash.exe', 'packsquash.exe')
from zipTree(downloadWin.dest)
into packSquashDir
rename('packsquash.exe', 'packsquash.exe')
}

rootProject.tasks.getByName('run').with {
dependsOn downloadLicense
dependsOn unzipLinux
dependsOn unzipMacOS
dependsOn unzipWin
dependsOn downloadLicense
dependsOn unzipLinux
dependsOn unzipMacOS
dependsOn unzipWin

copy {
from "../build/tools"
into '../run/tools'
}
copy {
from "../build/tools"
into '../run/tools'
}
}

distZip.with {
dependsOn downloadLicense
dependsOn unzipLinux
dependsOn unzipMacOS
dependsOn unzipWin
dependsOn downloadLicense
dependsOn unzipLinux
dependsOn unzipMacOS
dependsOn unzipWin
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* Copyright (c) 2021 DeflatedPickle under the MIT license */

package com.deflatedpickle.quiver.packsquashstep

import com.deflatedpickle.haruhi.util.ConfigUtil
Expand Down Expand Up @@ -46,7 +48,7 @@ object PackSquashStep : BulkExportStep() {
""".trimMargin()
// println(arguments)

val system = when(OSUtil.getOS()) {
val system = when (OSUtil.getOS()) {
OSUtil.OS.WINDOWS -> ""
OSUtil.OS.LINUX -> "linux"
OSUtil.OS.MAC -> "macos"
Expand Down Expand Up @@ -104,4 +106,4 @@ object PackSquashStep : BulkExportStep() {
}.start()
this.logger.debug("Started the PackSquash thread")
}
}
}
Loading

0 comments on commit 44886b3

Please sign in to comment.