Skip to main content

Build from a Jar App

目錄架構
.
├── app
│   ├── cc_wallet
│   │   └── CloudCoin.D.4.0.0.jar
│   └── CloudCoinWallet.sh
├── dark.png
└── snap
    ├── gui
    │   ├── cc_dark.png
    │   └── cloudcoin-wallet.dark.desktop
    └── snapcraft.yaml

snapcraft.yml

name: cloudcoin-wallet
version: "4.0.0"
summary: CloudCoin Wallet(Dark) Desktop Application
base: core18
description: |
  CloudCoin is a digital currency. That cannot be counterfeited, controlled, tracked or stolen. 
  CloudCoins cannot be double-spent, mined or lost. 
  It is 100% private and requires no public ledgers, accounts, or encryption. 
  CloudCoin is a completely fair and ethical monetary system.

  Learn more about CloudCoin on
  https://cloudcoin.global
confinement: devmode
grade: devel

environment:
  APP_VER: "4.0.0"
  LC_ALL: "C.UTF-8"
  JAVA_HOME: "$SNAP/usr/lib/jvm/java-11-openjdk-amd64"
  PATH: "$JAVA_HOME/bin:$PATH"
  XDG_DATA_HOME: "$SNAP/usr/share"
  FONTCONFIG_PATH: "$SNAP/etc/fonts/config.d"
  FONTCONFIG_FILE: "$SNAP/etc/fonts/fonts.conf"

apps:
  cloudcoin-wallet:
    command: bin/CloudCoinWallet.sh

plugs:
  unity7:
  network:
  home:
  x11:
  wayland:
  desktop:
  desktop-legacy:

parts:
  cloudcoin-wallet:
    source: app/
    plugin: dump
    organize:
      CloudCoinWallet.sh: bin/CloudCoinWallet.sh
    build-packages:
      - openjdk-11-jre-headless
      - ca-certificates-java
      - ca-certificates
    stage-packages:
      - fonts-dejavu-core
      - libfontconfig1
      - openjdk-11-jre-headless
      - ca-certificates-java
      - ca-certificates

CloudCoinWallet.sh

#!/bin/sh

java -jar $SNAP/cc_wallet/CloudCoin.D.4.0.9.jar

cloudcoin-wallet.desktop

[Desktop Entry]
Type=Application
Name=CloudCoin-Wallet.Dark
Comment=CloudCoin Wallet Desktop App - Dark Edition
Icon=${SNAP}/meta/gui/cc_dark.png
Exec=cloudcoin-wallet
Terminal=false
Categories=Finance;Network;
Build
snapcraft

Install the .snap

sudo snap install --dangerous cloudcoin-wallet_4.0.0_amd64.snap --devmode
Publish
snapcraft login
snapcraft upload --release=beta cloudcoin-wallet_4.0.9_amd64.snap