Merge branch 'develop'

This commit is contained in:
Carlo Sciolla 2019-05-09 22:08:47 +02:00
commit b3cfafbf99
No known key found for this signature in database
GPG Key ID: BA5D71E6F3C580C1
6 changed files with 73 additions and 0 deletions

View File

@ -4,6 +4,11 @@ version: 2.0
default: &default-steps
steps:
- checkout
- run:
# Note: this makes it hard to reproduce builds but easier to spot incompatibilities with
# newer PlantUML releases. Current trade off seems acceptable.
name: Download the latest PlantUML release
command: sh ./bin/download-plantuml.sh
- run:
name: Update APT packages
command: apt-get update

17
.github/stale.yml vendored Normal file
View File

@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 90
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 10
# Issues with these labels will never be considered stale
exemptLabels:
- help-wanted
- enhancement
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

View File

@ -26,6 +26,10 @@ Also, to enable preview you need to tell `plantuml-mode` where to locate the Pla
M-x customize-variable<RET>
plantuml-jar-path<RET>
You can also download the latest version of PlantUML straight into `plantuml-jar-path`:
M-x plantuml-download-jar<RET>
# Features
- Syntax highlight

20
bin/download-plantuml.sh Normal file
View File

@ -0,0 +1,20 @@
#!/bin/sh
# Where the script is executed
CURRENT_PATH="$(dirname "$(readlink -f "$0")")"
# Where to download the file
OUTPUT_PATH="${CURRENT_PATH}/plantuml.jar"
# Retrieve the list of versions, in XML format, only one result (the latest)
VERSIONS_URL='https://search.maven.org/solrsearch/select?q=g:net.sourceforge.plantuml+AND+a:plantuml&core=gav&start=0&rows=1&wt=xml'
# Only match the contents of the version (name="v") XML tag
LATEST_VERSION="$(curl -s "${VERSIONS_URL}" | grep -oP '(?<=<str name="v">).*(?=</str>)')"
# Compose the download link
DOWNLOAD_URL="https://search.maven.org/remotecontent?filepath=net/sourceforge/plantuml/plantuml/${LATEST_VERSION}/plantuml-${LATEST_VERSION}.jar"
# finally, download the JAR file
echo "Downloading PlantUML v${LATEST_VERSION} into ${OUTPUT_PATH}"
curl -so "${OUTPUT_PATH}" "${DOWNLOAD_URL}" 2>/dev/null

Binary file not shown.

View File

@ -37,6 +37,7 @@
;;; Change log:
;;
;; version 1.2.11, 2019-04-09 Added `plantuml-download-jar'
;; version 1.2.10, 2019-04-03 Avoid messing with window layouts and buffers -- courtesy of https://github.com/wailo
;; version 1.2.9, Revamped indentation support, now working with a greater number of keywords
;; version 1.2.8, 2019-01-07 Support indentation for activate / deactivate blocks; allow customization of `plantuml-java-args'
@ -69,6 +70,7 @@
;;; Code:
(require 'thingatpt)
(require 'dash)
(require 'xml)
(defgroup plantuml-mode nil
"Major mode for editing plantuml file."
@ -163,6 +165,31 @@
(insert msg)
(insert "\n"))))))
(defun plantuml-download-jar ()
"Download the latest PlantUML JAR file and install it into `plantuml-jar-path'."
(interactive)
(if (y-or-n-p (format "Download the latest PlantUML JAR file into %s? " plantuml-jar-path))
(if (or (not (file-exists-p plantuml-jar-path))
(y-or-n-p (format "The PlantUML jar file already exists at %s, overwrite? " plantuml-jar-path)))
(with-current-buffer (url-retrieve-synchronously "https://search.maven.org/solrsearch/select?q=g:net.sourceforge.plantuml+AND+a:plantuml&core=gav&start=0&rows=1&wt=xml")
(mkdir (file-name-directory plantuml-jar-path) t)
(let* ((parse-tree (xml-parse-region))
(doc (->> parse-tree
(assq 'response)
(assq 'result)
(assq 'doc)))
(strs (xml-get-children doc 'str))
(version (->> strs
(--filter (string-equal "v" (xml-get-attribute it 'name)))
(first)
(xml-node-children)
(first))))
(message (concat "Downloading PlantUML v" version " into " plantuml-jar-path))
(url-copy-file (format "https://search.maven.org/remotecontent?filepath=net/sourceforge/plantuml/plantuml/%s/plantuml-%s.jar" version version) plantuml-jar-path)
(kill-buffer))
(message "Aborted.")))
(message "Aborted.")))
(defun plantuml-init ()
"Initialize the keywords or builtins from the cmdline language output."
(unless (or (eq system-type 'cygwin) (file-exists-p plantuml-jar-path))