Skip to content

Allow overriding snap name independently of packageName #244

@Wavesonics

Description

@Wavesonics

Problem

SnapSettings (SnapSettings.kt) has no property for the snap's name — the name used in meta/snap.yaml and visible to the Snap Store. As far as I can tell, the name is derived from nativeDistributions.packageName (via electron-builder's productName).

This makes it impossible to use Nucleus's snap target for projects whose Snap Store registration uses a name distinct from packageName.

Proposal

Add a name: String? property to SnapSettings:

abstract class SnapSettings {
    /** Override the snap name (used in meta/snap.yaml and Snap Store namespace).
     *  Defaults to [NativeDistributions.packageName] if null. */
    var name: String? = null
    // ... existing properties
}

In AbstractElectronBuilderPackageTask (snap branch only), use snap.name ?: distributions.packageName for the relevant electron-builder config (likely a snap-scoped productName override, or the snapcraft name: field directly).

A more general snap { productName = "..." } override would also work and is consistent with electron-builder's own DSL, where snap.productName can override the top-level productName.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp1

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions