Browse Source
Add file associations support to Compose Desktop <!-- Optional --> Fixes #773 ## Testing Tested on the [sample project](https://github.com/zhelenskiy/file-associations-demo). Behaviours per OSs: - MacOS Sonoma: associations work for distributables. - Windows 11: associations work after the installation of the MSI. - Kubuntu: associations do not work, but everything else works fine. However, IDEA also does not have associations there, so I assume this is fine. I didn't write any unit tests because I don’t know which of them you are expecting me to write. So, I'm looking forward to your feedback and suggestions. <!-- Optional --> This should be tested by QA ## Release Notes <!-- Optional, if omitted - won't be included in the changelog Sections: - Highlights - Known issues - Breaking changes - Features - Fixes Subsections: - Multiple Platforms - iOS - Desktop - Web - Resources - Gradle Plugin --> ### Highlight - Desktop - Introduction of the new DSL function in `nativeDistributions` block: ```kotlin fun fileAssociation(mimeType: String, extension: String, description: String): Unit ```pull/5076/head v1.7.0-alpha01
Evgeniy Zhelenskiy
4 months ago
committed by
GitHub
12 changed files with 337 additions and 61 deletions
@ -0,0 +1,11 @@
|
||||
package org.jetbrains.compose.desktop.application.dsl |
||||
|
||||
import java.io.File |
||||
import java.io.Serializable |
||||
|
||||
internal data class FileAssociation( |
||||
val mimeType: String, |
||||
val extension: String, |
||||
val description: String, |
||||
val iconFile: File?, |
||||
) : Serializable |
@ -1,48 +1,123 @@
|
||||
<?xml version="1.0" ?> |
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
<plist version="1.0"> |
||||
<dict> |
||||
<key>LSMinimumSystemVersion</key> |
||||
<string>12.0</string> |
||||
<key>CFBundleDevelopmentRegion</key> |
||||
<string>English</string> |
||||
<key>CFBundleAllowMixedLocalizations</key> |
||||
<string>true</string> |
||||
<key>CFBundleExecutable</key> |
||||
<string>TestPackage</string> |
||||
<key>CFBundleIconFile</key> |
||||
<string>TestPackage.icns</string> |
||||
<key>CFBundleIdentifier</key> |
||||
<string>MainKt</string> |
||||
<key>CFBundleInfoDictionaryVersion</key> |
||||
<string>6.0</string> |
||||
<key>CFBundleName</key> |
||||
<string>TestPackage</string> |
||||
<key>CFBundlePackageType</key> |
||||
<string>APPL</string> |
||||
<key>CFBundleShortVersionString</key> |
||||
<string>1.0.0</string> |
||||
<key>LSApplicationCategoryType</key> |
||||
<string>Unknown</string> |
||||
<key>CFBundleVersion</key> |
||||
<string>1.0.0</string> |
||||
<key>NSHumanReadableCopyright</key> |
||||
<string>Copyright (C) CURRENT_YEAR</string> |
||||
<key>NSSupportsAutomaticGraphicsSwitching</key> |
||||
<string>true</string> |
||||
<key>NSHighResolutionCapable</key> |
||||
<string>true</string> |
||||
<dict> |
||||
<key>LSMinimumSystemVersion</key> |
||||
<string>12.0</string> |
||||
<key>CFBundleDevelopmentRegion</key> |
||||
<string>English</string> |
||||
<key>CFBundleAllowMixedLocalizations</key> |
||||
<string>true</string> |
||||
<key>CFBundleExecutable</key> |
||||
<string>TestPackage</string> |
||||
<key>CFBundleIconFile</key> |
||||
<string>TestPackage.icns</string> |
||||
<key>CFBundleIdentifier</key> |
||||
<string>MainKt</string> |
||||
<key>CFBundleInfoDictionaryVersion</key> |
||||
<string>6.0</string> |
||||
<key>CFBundleName</key> |
||||
<string>TestPackage</string> |
||||
<key>CFBundlePackageType</key> |
||||
<string>APPL</string> |
||||
<key>CFBundleShortVersionString</key> |
||||
<string>1.0.0</string> |
||||
<key>LSApplicationCategoryType</key> |
||||
<string>Unknown</string> |
||||
<key>CFBundleVersion</key> |
||||
<string>1.0.0</string> |
||||
<key>NSHumanReadableCopyright</key> |
||||
<string>Copyright (C) CURRENT_YEAR</string> |
||||
<key>NSSupportsAutomaticGraphicsSwitching</key> |
||||
<string>true</string> |
||||
<key>NSHighResolutionCapable</key> |
||||
<string>true</string> |
||||
<key>CFBundleDocumentTypes</key> |
||||
<array> |
||||
<dict> |
||||
<key>CFBundleTypeRole</key> |
||||
<string>Editor</string> |
||||
<key>CFBundleTypeExtensions</key> |
||||
<array> |
||||
<string>kot</string> |
||||
</array> |
||||
<key>CFBundleTypeIconFile</key> |
||||
<string>Kotlin_icon_big.icns</string> |
||||
<key>CFBundleTypeMIMETypes</key> |
||||
<string>text/kotlin</string> |
||||
<key>CFBundleTypeName</key> |
||||
<string>Kotlin Source File0</string> |
||||
<key>CFBundleTypeOSTypes</key> |
||||
<array> |
||||
<string>****</string> |
||||
</array> |
||||
</dict> |
||||
<dict> |
||||
<key>CFBundleTypeRole</key> |
||||
<string>Editor</string> |
||||
<key>CFBundleTypeExtensions</key> |
||||
<array> |
||||
<string>kot1</string> |
||||
</array> |
||||
<key>CFBundleTypeIconFile</key> |
||||
<string>TestPackage.icns</string> |
||||
<key>CFBundleTypeMIMETypes</key> |
||||
<string>text/kotlin</string> |
||||
<key>CFBundleTypeName</key> |
||||
<string>Kotlin Source File1</string> |
||||
<key>CFBundleTypeOSTypes</key> |
||||
<array> |
||||
<string>****</string> |
||||
</array> |
||||
</dict> |
||||
<dict> |
||||
<key>CFBundleTypeRole</key> |
||||
<string>Editor</string> |
||||
<key>CFBundleTypeExtensions</key> |
||||
<array> |
||||
<string>kott</string> |
||||
</array> |
||||
<key>CFBundleTypeIconFile</key> |
||||
<string>Kotlin_icon_big (1).icns</string> |
||||
<key>CFBundleTypeMIMETypes</key> |
||||
<string>text/kotlin</string> |
||||
<key>CFBundleTypeName</key> |
||||
<string>Kotlin Source File2</string> |
||||
<key>CFBundleTypeOSTypes</key> |
||||
<array> |
||||
<string>****</string> |
||||
</array> |
||||
</dict> |
||||
<dict> |
||||
<key>CFBundleTypeRole</key> |
||||
<string>Editor</string> |
||||
<key>CFBundleTypeExtensions</key> |
||||
<array> |
||||
<string>kott1</string> |
||||
</array> |
||||
<key>CFBundleTypeIconFile</key> |
||||
<string>TestPackage.icns</string> |
||||
<key>CFBundleTypeMIMETypes</key> |
||||
<string>text/kotlin</string> |
||||
<key>CFBundleTypeName</key> |
||||
<string>Kotlin Source File3</string> |
||||
<key>CFBundleTypeOSTypes</key> |
||||
<array> |
||||
<string>****</string> |
||||
</array> |
||||
</dict> |
||||
</array> |
||||
|
||||
<key>CFBundleURLTypes</key> |
||||
<array> |
||||
<dict> |
||||
<key>CFBundleURLName</key> |
||||
<string>Exameple URL</string> |
||||
<key>CFBundleURLSchemes</key> |
||||
<array> |
||||
<string>exampleUrl</string> |
||||
</array> |
||||
</dict> |
||||
</array> |
||||
</dict> |
||||
<key>CFBundleURLTypes</key> |
||||
<array> |
||||
<dict> |
||||
<key>CFBundleURLName</key> |
||||
<string>Example URL</string> |
||||
<key>CFBundleURLSchemes</key> |
||||
<array> |
||||
<string>exampleUrl</string> |
||||
</array> |
||||
</dict> |
||||
</array> |
||||
</dict> |
||||
</plist> |
||||
|
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 36 KiB |
Loading…
Reference in new issue