Skip to content

Commit

Permalink
Merge pull request #2345 from JabRef/snapcraft
Browse files Browse the repository at this point in the history
Initial shot for snapcraft.yaml
  • Loading branch information
koppor authored Aug 11, 2017
2 parents b5de6a9 + c2fb270 commit 18fffc6
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 3 deletions.
11 changes: 8 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ sourceSets {
}

processResources {
filteringCharset = 'UTF-8'

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

filesMatching("resource/**/meta.xml") {
expand version: project.version
Expand Down Expand Up @@ -369,19 +370,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]

0 comments on commit 18fffc6

Please sign in to comment.