Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial shot for snapcraft.yaml #2345

Merged
merged 1 commit into from
Aug 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ sourceSets {
}

processResources {
filteringCharset = 'UTF-8'

filesMatching("build.properties") {
expand(version: project.version,
"year": String.valueOf(Calendar.getInstance().get(Calendar.YEAR)),
Expand All @@ -161,7 +163,6 @@ processResources {
"azureInstrumentationKey": System.getenv('AzureInstrumentationKey'))
filteringCharset = 'UTF-8'
}
filteringCharset = 'UTF-8'

filesMatching("resource/**/meta.xml") {
expand version: project.version
Expand Down Expand Up @@ -368,19 +369,23 @@ task release(dependsOn: ["media", "releaseJar"]) {
task releaseJar(dependsOn: "shadowJar") {
group = 'JabRef - Release'
description "Creates a Jar release."

doLast {
copy {
from("$buildDir/libs/JabRef-${project.version}-fat.jar")
into("$buildDir/releases")

rename { String fileName ->
fileName.replace('-fat', '')
}
}
// set executable with read permissions (first true) and for all (false)
file("$buildDir/releases/JabRef-${project.version}.jar").setExecutable(true, false);
}
}

task snapJar(dependsOn: "releaseJar", type: Delete) {
delete fileTree(dir: "$buildDir/releases/", exclude: "JabRef-${project.version}.jar")
}

jmh {
warmupIterations = 5
iterations = 10
Expand Down
1 change: 1 addition & 0 deletions snap/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.snapcraft/
Binary file added snap/gui/JabRef-icon-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions snap/gui/jabref.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Name=JabRef
Comment=JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format.
Type=Application
Terminal=false
Icon=${SNAP}/meta/gui/JabRef-icon-256.png
Exec=jabref
Keywords=bibtex;biblatex;latex;bibliography
Categories=Utility;
27 changes: 27 additions & 0 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# based on https://github.com/snapcore/snapcraft/blob/master/demos/gradle/snap/snapcraft.yaml

name: jabref

# the version string 4.0-dev is replaced by scripts/run-snapcraft.sh with the current version provided in build.gradle
version: '4.0-dev'

summary: Bibliography manager
icon: snap/gui/JabRef-icon-256.png
description: JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format.

grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

apps:
jabref:
command: desktop-launch java -jar $SNAP/jar/JabRef-4.0-dev.jar
plugs: [home, network-bind, x11]

parts:
jabref:
plugin: gradle
source: .
stage-packages: [default-jre, openjfx, libglib2.0-bin, x11-utils]
gradle-options: [snapJar]
gradle-output-dir: 'build/releases'
after: [desktop-gtk3]