Compare commits
10 Commits
7f7d829c93
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
b948f685e4 | ||
|
d550196ff7 | ||
|
7398c1fd56 | ||
|
f94feb50f9 | ||
|
99d3e51e5d | ||
|
cc4e83ed53 | ||
|
7edd1ca475 | ||
|
c399677ab7 | ||
|
dee9a61d87 | ||
|
44c945cd45 |
129
Cargo.lock
generated
129
Cargo.lock
generated
@@ -1,3 +1,5 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "aho-corasick"
|
||||
version = "0.6.9"
|
||||
@@ -87,6 +89,18 @@ name = "c_str_macro"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "cargo_metadata"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.0.28"
|
||||
@@ -141,6 +155,14 @@ dependencies = [
|
||||
"termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "error-chain"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"backtrace 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "failure"
|
||||
version = "0.1.5"
|
||||
@@ -171,6 +193,11 @@ dependencies = [
|
||||
"quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
version = "1.2.0"
|
||||
@@ -221,6 +248,11 @@ name = "peeking_take_while"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "peresil"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "pkg-config"
|
||||
version = "0.3.14"
|
||||
@@ -285,6 +317,11 @@ name = "rustc-demangle"
|
||||
version = "0.1.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "0.2.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "scopeguard"
|
||||
version = "0.3.3"
|
||||
@@ -293,6 +330,50 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
[[package]]
|
||||
name = "scouter"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"cargo_metadata 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sxd-document 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sxd-xpath 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "semver"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "semver-parser"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.88"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.88"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.38"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "shenlong"
|
||||
@@ -321,6 +402,35 @@ name = "strsim"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "sxd-document"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"peresil 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"typed-arena 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sxd-xpath"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"peresil 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sxd-document 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "0.15.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "termcolor"
|
||||
version = "1.0.4"
|
||||
@@ -355,6 +465,11 @@ dependencies = [
|
||||
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typed-arena"
|
||||
version = "1.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "ucd-util"
|
||||
version = "0.1.3"
|
||||
@@ -441,16 +556,19 @@ dependencies = [
|
||||
"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
|
||||
"checksum byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a019b10a2a7cdeb292db131fc8113e57ea2a908f6e7894b0c3c671893b65dbeb"
|
||||
"checksum c_str_macro 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2e08268d37bbcbf98f70312c449a35763d3f85beafbedbb4e28b4c438e2b5bd"
|
||||
"checksum cargo_metadata 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "585784cac9b05c93a53b17a0b24a5cdd1dfdda5256f030e089b549d2390cc720"
|
||||
"checksum cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4a8b715cb4597106ea87c7c84b2f1d452c7492033765df7f32651e66fcf749"
|
||||
"checksum cexpr 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "644d693ecfa91955ed32dcc7eda4914e1be97a641fb6f0645a37348e20b230da"
|
||||
"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4"
|
||||
"checksum clang-sys 0.26.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6ef0c1bcf2e99c649104bd7a7012d8f8802684400e03db0ec0af48583c6fa0e4"
|
||||
"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"
|
||||
"checksum env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "afb070faf94c85d17d50ca44f6ad076bce18ae92f0037d350947240a36e9d42e"
|
||||
"checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02"
|
||||
"checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2"
|
||||
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
|
||||
"checksum hashbrown 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3bae29b6653b3412c2e71e9d486db9f9df5d701941d86683005efb9f2d28e3da"
|
||||
"checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114"
|
||||
"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b"
|
||||
"checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1"
|
||||
"checksum libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)" = "e962c7641008ac010fa60a7dfdc1712449f29c44ef2d4702394aea943ee75047"
|
||||
"checksum libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2"
|
||||
@@ -458,6 +576,7 @@ dependencies = [
|
||||
"checksum memchr 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e1dd4eaac298c32ce07eb6ed9242eda7d82955b9170b7d6db59b2e02cc63fcb8"
|
||||
"checksum nom 4.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b30adc557058ce00c9d0d7cb3c6e0b5bc6f36e2e2eabe74b0ba726d194abd588"
|
||||
"checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
|
||||
"checksum peresil 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f658886ed52e196e850cfbbfddab9eaa7f6d90dd0929e264c31e5cec07e09e57"
|
||||
"checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c"
|
||||
"checksum proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)" = "4d317f9caece796be1980837fd5cb3dfec5613ebdb04ad0956deea83ce168915"
|
||||
"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0"
|
||||
@@ -467,12 +586,22 @@ dependencies = [
|
||||
"checksum regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "37e7cbbd370869ce2e8dff25c7018702d10b21a20ef7135316f8daecd6c25b7f"
|
||||
"checksum regex-syntax 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8c2f35eedad5295fdf00a63d7d4b238135723f92b434ec06774dad15c7ab0861"
|
||||
"checksum rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "adacaae16d02b6ec37fdc7acfcddf365978de76d1983d3ee22afc260e1ca9619"
|
||||
"checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7"
|
||||
"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
|
||||
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
|
||||
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
|
||||
"checksum serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)" = "9f301d728f2b94c9a7691c90f07b0b4e8a4517181d9461be94c04bddeb4bd850"
|
||||
"checksum serde_derive 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)" = "beed18e6f5175aef3ba670e57c60ef3b1b74d250d962a26604bff4c80e970dd4"
|
||||
"checksum serde_json 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)" = "27dce848e7467aa0e2fcaf0a413641499c0b745452aaca1194d24dedde9e13c9"
|
||||
"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
|
||||
"checksum sxd-document 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f9daa5f04135690dcb001fd5d4f1d536d62e988262954e68abb3ab7db36a4f9"
|
||||
"checksum sxd-xpath 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "36e39da5d30887b5690e29de4c5ebb8ddff64ebd9933f98a01daaa4fd11b36ea"
|
||||
"checksum syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)" = "f92e629aa1d9c827b2bb8297046c1ccffc57c99b947a680d3ccff1f136a3bee9"
|
||||
"checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f"
|
||||
"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
|
||||
"checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6"
|
||||
"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
|
||||
"checksum typed-arena 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c6c06a92aef38bb4dc5b0df00d68496fc31307c5344c867bb61678c6e1671ec5"
|
||||
"checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86"
|
||||
"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526"
|
||||
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
|
||||
|
2
install_builddeps
Executable file
2
install_builddeps
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
sudo apt-get build-dep clang geany geany-plugins
|
236
scouter/Cargo.lock
generated
236
scouter/Cargo.lock
generated
@@ -1,4 +1,238 @@
|
||||
[[package]]
|
||||
name = "autocfg"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "backtrace"
|
||||
version = "0.3.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "backtrace-sys"
|
||||
version = "0.1.28"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cc 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cargo_metadata"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.0.29"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "error-chain"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"backtrace 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.48"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "peresil"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "0.4.27"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quick-error"
|
||||
version = "1.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "0.6.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-demangle"
|
||||
version = "0.1.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "0.2.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "scouter"
|
||||
version = "0.1.0"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"cargo_metadata 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sxd-document 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sxd-xpath 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "semver"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "semver-parser"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.88"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.88"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.38"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sxd-document"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"peresil 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"typed-arena 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sxd-xpath"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"peresil 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sxd-document 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "0.15.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typed-arena"
|
||||
version = "1.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-xid"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.3.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winapi-i686-pc-windows-gnu"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "winapi-x86_64-pc-windows-gnu"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[metadata]
|
||||
"checksum autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a6d640bee2da49f60a4068a7fae53acde8982514ab7bae8b8cea9e88cbcfd799"
|
||||
"checksum backtrace 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)" = "b5b493b66e03090ebc4343eb02f94ff944e0cbc9ac6571491d170ba026741eb5"
|
||||
"checksum backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "797c830ac25ccc92a7f8a7b9862bde440715531514594a6154e3d4a54dd769b6"
|
||||
"checksum cargo_metadata 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "585784cac9b05c93a53b17a0b24a5cdd1dfdda5256f030e089b549d2390cc720"
|
||||
"checksum cc 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)" = "4390a3b5f4f6bce9c1d0c00128379df433e53777fdd30e92f16a529332baec4e"
|
||||
"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4"
|
||||
"checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02"
|
||||
"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b"
|
||||
"checksum libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)" = "e962c7641008ac010fa60a7dfdc1712449f29c44ef2d4702394aea943ee75047"
|
||||
"checksum peresil 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f658886ed52e196e850cfbbfddab9eaa7f6d90dd0929e264c31e5cec07e09e57"
|
||||
"checksum proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)" = "4d317f9caece796be1980837fd5cb3dfec5613ebdb04ad0956deea83ce168915"
|
||||
"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0"
|
||||
"checksum quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "cdd8e04bd9c52e0342b406469d494fcb033be4bdbe5c606016defbb1681411e1"
|
||||
"checksum rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "adacaae16d02b6ec37fdc7acfcddf365978de76d1983d3ee22afc260e1ca9619"
|
||||
"checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7"
|
||||
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
|
||||
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
|
||||
"checksum serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)" = "9f301d728f2b94c9a7691c90f07b0b4e8a4517181d9461be94c04bddeb4bd850"
|
||||
"checksum serde_derive 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)" = "beed18e6f5175aef3ba670e57c60ef3b1b74d250d962a26604bff4c80e970dd4"
|
||||
"checksum serde_json 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)" = "27dce848e7467aa0e2fcaf0a413641499c0b745452aaca1194d24dedde9e13c9"
|
||||
"checksum sxd-document 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f9daa5f04135690dcb001fd5d4f1d536d62e988262954e68abb3ab7db36a4f9"
|
||||
"checksum sxd-xpath 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "36e39da5d30887b5690e29de4c5ebb8ddff64ebd9933f98a01daaa4fd11b36ea"
|
||||
"checksum syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)" = "f92e629aa1d9c827b2bb8297046c1ccffc57c99b947a680d3ccff1f136a3bee9"
|
||||
"checksum typed-arena 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c6c06a92aef38bb4dc5b0df00d68496fc31307c5344c867bb61678c6e1671ec5"
|
||||
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
|
||||
"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0"
|
||||
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
||||
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||
|
@@ -5,3 +5,6 @@ authors = ["Adrian Malacoda <adrian.malacoda@monarch-pass.net>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
cargo_metadata = "0.7.1"
|
||||
sxd-xpath = "0.4.2"
|
||||
sxd-document = "0.3.0"
|
||||
|
5
scouter/README.md
Normal file
5
scouter/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Scouter
|
||||
Small library for detecting and gathering information about projects.
|
||||
|
||||
## License
|
||||
GNU AGPLv3 or later.
|
@@ -1,4 +1,5 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::Command;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum ProjectType {
|
||||
@@ -20,6 +21,30 @@ impl ProjectType {
|
||||
|
||||
None
|
||||
}
|
||||
|
||||
pub fn build_command(&self) -> Vec<String> {
|
||||
match self {
|
||||
ProjectType::Maven => vec!["mvn".to_owned(), "install".to_owned()],
|
||||
ProjectType::Npm => vec!["npm".to_owned(), "build".to_owned()],
|
||||
ProjectType::Cargo => vec!["cargo".to_owned(), "build".to_owned()]
|
||||
}
|
||||
}
|
||||
|
||||
pub fn run_command(&self) -> Vec<String> {
|
||||
match self {
|
||||
ProjectType::Maven => vec!["mvn".to_owned(), "exec".to_owned()],
|
||||
ProjectType::Npm => vec!["npm".to_owned(), "start".to_owned()],
|
||||
ProjectType::Cargo => vec!["cargo".to_owned(), "run".to_owned()]
|
||||
}
|
||||
}
|
||||
|
||||
pub fn install_command(&self) -> Vec<String> {
|
||||
match self {
|
||||
ProjectType::Maven => vec!["mvn".to_owned(), "install".to_owned()],
|
||||
ProjectType::Npm => vec!["npm".to_owned(), "install".to_owned()],
|
||||
ProjectType::Cargo => vec!["cargo".to_owned(), "install".to_owned()]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -34,29 +59,90 @@ impl Project {
|
||||
}
|
||||
|
||||
pub fn info(&self) -> ProjectInfo {
|
||||
match self.project_type {
|
||||
ProjectType::Maven => ProjectInfo {
|
||||
name: "placeholder".into(),
|
||||
version: "placeholder".into()
|
||||
match self.project_type {
|
||||
ProjectType::Maven => {
|
||||
let effective_pom = self.read_effective_pom();
|
||||
ProjectInfo::from_pom(&effective_pom)
|
||||
},
|
||||
ProjectType::Npm => ProjectInfo {
|
||||
name: "placeholder".into(),
|
||||
version: "placeholder".into()
|
||||
},
|
||||
ProjectType::Cargo => ProjectInfo {
|
||||
name: "placeholder".into(),
|
||||
version: "placeholder".into()
|
||||
}
|
||||
ProjectType::Cargo => self.read_cargo_metadata().into()
|
||||
}
|
||||
}
|
||||
|
||||
fn read_cargo_metadata(&self) -> cargo_metadata::Metadata {
|
||||
cargo_metadata::MetadataCommand::new()
|
||||
.current_dir(&self.path)
|
||||
.exec()
|
||||
.expect("metadata call failed")
|
||||
}
|
||||
|
||||
fn read_effective_pom(&self) -> sxd_document::Package {
|
||||
let full_output = std::str::from_utf8(&Command::new("mvn")
|
||||
.arg("help:effective-pom")
|
||||
.current_dir(&self.path)
|
||||
.output()
|
||||
.expect("failed to generate effective pom")
|
||||
.stdout).expect("failed to generate string from output").to_owned();
|
||||
let xml = full_output.get(
|
||||
full_output.find("<?xml").expect("failed to find start of xml")
|
||||
..
|
||||
full_output.find("</project>").expect("failed to find end of xml") + 10
|
||||
).expect("failed to extract xml body");
|
||||
sxd_document::parser::parse(xml).expect("failed to parse effective pom")
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct ProjectInfo {
|
||||
pub name: String,
|
||||
pub name: String,
|
||||
pub version: String
|
||||
}
|
||||
|
||||
impl From<cargo_metadata::Metadata> for ProjectInfo {
|
||||
fn from(metadata: cargo_metadata::Metadata) -> Self {
|
||||
let root_package_id = metadata.resolve
|
||||
.expect("non-existent resolve field")
|
||||
.root
|
||||
.expect("non-existent root package id");
|
||||
let package = metadata.packages.into_iter()
|
||||
.find(|package| package.id == root_package_id)
|
||||
.expect("failed to find package in metadata");
|
||||
ProjectInfo {
|
||||
name: package.name.into(),
|
||||
version: format!("{}", package.version)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ProjectInfo {
|
||||
fn from_pom(pom: &sxd_document::Package) -> Self {
|
||||
let document = pom.as_document();
|
||||
|
||||
let mut context = sxd_xpath::context::Context::new();
|
||||
context.set_namespace("mvn", "http://maven.apache.org/POM/4.0.0");
|
||||
|
||||
let factory = sxd_xpath::Factory::new();
|
||||
let name_xpath = factory.build("/mvn:project/mvn:name")
|
||||
.expect("failed to compile name xpath")
|
||||
.expect("No XPath was compiled");
|
||||
let version_xpath = factory.build("/mvn:project/mvn:version")
|
||||
.expect("failed to compile name xpath")
|
||||
.expect("No XPath was compiled");
|
||||
|
||||
ProjectInfo {
|
||||
name: name_xpath.evaluate(&context, document.root())
|
||||
.expect("failed to evaluate name expression")
|
||||
.into_string(),
|
||||
version: version_xpath.evaluate(&context, document.root())
|
||||
.expect("failed to evaluate version expression")
|
||||
.into_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Scouter {
|
||||
search_path: PathBuf
|
||||
}
|
||||
@@ -103,6 +189,20 @@ mod test {
|
||||
#[test]
|
||||
fn test_scouter() {
|
||||
let mut scouter = Scouter::new(file!());
|
||||
assert_eq!(ProjectType::Cargo, scouter.next().unwrap().project_type);
|
||||
let project = scouter.next().unwrap();
|
||||
let project_info = project.info();
|
||||
assert_eq!(ProjectType::Cargo, project.project_type);
|
||||
assert_eq!(env!("CARGO_PKG_NAME"), project_info.name);
|
||||
assert_eq!(env!("CARGO_PKG_VERSION"), project_info.version);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_maven_project() {
|
||||
let mut scouter = Scouter::new(format!("{}/testdata/maven", env!("CARGO_MANIFEST_DIR")));
|
||||
let project = scouter.next().unwrap();
|
||||
let project_info = project.info();
|
||||
assert_eq!(ProjectType::Maven, project.project_type);
|
||||
assert_eq!("Shenlong Maven Test Project", project_info.name);
|
||||
assert_eq!("1.0.0-SNAPSHOT", project_info.version);
|
||||
}
|
||||
}
|
||||
|
42
scouter/testdata/maven/pom.xml
vendored
Normal file
42
scouter/testdata/maven/pom.xml
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>net.monarchpass</groupId>
|
||||
<artifactId>shenlong-maven-test</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Shenlong Maven Test Project</name>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.11</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.googlecode.json-simple</groupId>
|
||||
<artifactId>json-simple</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<configuration>
|
||||
<source>7</source>
|
||||
<target>7</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
117
src/lib.rs
117
src/lib.rs
@@ -1,8 +1,47 @@
|
||||
use c_str_macro::c_str;
|
||||
use shenlong_sys::*;
|
||||
use std::ffi::CStr;
|
||||
use std::ptr;
|
||||
use std::mem::transmute;
|
||||
use scouter::Scouter;
|
||||
|
||||
extern "C" fn shenlong_init(plugin: *mut GeanyPlugin, pdata: gpointer) -> gboolean {
|
||||
println!("shenlong init");
|
||||
|
||||
unsafe {
|
||||
plugin_signal_connect(
|
||||
plugin,
|
||||
ptr::null_mut(),
|
||||
c_str!("document-open").to_owned().as_ptr(),
|
||||
0,
|
||||
Some(transmute(shenlong_document_open as usize)),
|
||||
ptr::null_mut()
|
||||
);
|
||||
plugin_signal_connect(
|
||||
plugin,
|
||||
ptr::null_mut(),
|
||||
c_str!("document-activate").to_owned().as_ptr(),
|
||||
0,
|
||||
Some(transmute(shenlong_document_activate as usize)),
|
||||
ptr::null_mut()
|
||||
);
|
||||
plugin_signal_connect(
|
||||
plugin,
|
||||
ptr::null_mut(),
|
||||
c_str!("document-new").to_owned().as_ptr(),
|
||||
0,
|
||||
Some(transmute(shenlong_document_new as usize)),
|
||||
ptr::null_mut()
|
||||
);
|
||||
plugin_signal_connect(
|
||||
plugin,
|
||||
ptr::null_mut(),
|
||||
c_str!("document-save").to_owned().as_ptr(),
|
||||
0,
|
||||
Some(transmute(shenlong_document_save as usize)),
|
||||
ptr::null_mut()
|
||||
);
|
||||
}
|
||||
1
|
||||
}
|
||||
|
||||
@@ -10,6 +49,38 @@ extern "C" fn shenlong_cleanup(plugin: *mut GeanyPlugin, pdata: gpointer) {
|
||||
println!("shenlong cleanup");
|
||||
}
|
||||
|
||||
extern "C" fn shenlong_document_open(obj: *mut GObject, doc: *mut GeanyDocument, user_data: gpointer) {
|
||||
let document_path = unsafe { CStr::from_ptr((*doc).real_path).to_str().expect("failed to get document path") };
|
||||
println!("shenlong document open: {:?}", document_path);
|
||||
let mut scouter = Scouter::new(document_path);
|
||||
if let Some(project) = scouter.next() {
|
||||
println!("-- shenlong project open: {:?}", project);
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" fn shenlong_document_activate(obj: *mut GObject, doc: *mut GeanyDocument, user_data: gpointer) {
|
||||
let document_path = unsafe { CStr::from_ptr((*doc).real_path).to_str().expect("failed to get document path") };
|
||||
println!("shenlong document activate: {:?}", document_path);
|
||||
let mut scouter = Scouter::new(document_path);
|
||||
if let Some(project) = scouter.next() {
|
||||
println!("-- shenlong project open: {:?}", project);
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" fn shenlong_document_new(obj: *mut GObject, doc: *mut GeanyDocument, user_data: gpointer) {
|
||||
println!("shenlong document new");
|
||||
}
|
||||
|
||||
extern "C" fn shenlong_document_save(obj: *mut GObject, doc: *mut GeanyDocument, user_data: gpointer) {
|
||||
unsafe {
|
||||
println!("shenlong document save: {:?}", CStr::from_ptr((*doc).real_path).to_str());
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" fn shenlong_empty_callback() {
|
||||
println!("shenlong empty callback");
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn geany_load_module(plugin: *mut GeanyPlugin) {
|
||||
println!("loading shenlong module");
|
||||
@@ -24,6 +95,52 @@ pub extern "C" fn geany_load_module(plugin: *mut GeanyPlugin) {
|
||||
plugin_funcs.init = Some(shenlong_init);
|
||||
plugin_funcs.cleanup = Some(shenlong_cleanup);
|
||||
|
||||
/*let mut plugin_callbacks: [PluginCallback; 6] = [
|
||||
PluginCallback {
|
||||
signal_name: c_str!("document-open").to_owned().into_raw(),
|
||||
callback: Some(transmute(shenlong_document_open as usize)),
|
||||
//callback: Some(shenlong_empty_callback),
|
||||
after: 0,
|
||||
user_data: ptr::null_mut()
|
||||
},
|
||||
PluginCallback {
|
||||
signal_name: c_str!("document-new").to_owned().into_raw(),
|
||||
//callback: Some(transmute(shenlong_document_new as usize)),
|
||||
callback: Some(shenlong_empty_callback),
|
||||
after: 0,
|
||||
user_data: ptr::null_mut()
|
||||
},
|
||||
PluginCallback {
|
||||
signal_name: c_str!("document-close").to_owned().into_raw(),
|
||||
//callback: Some(transmute(shenlong_document_new as usize)),
|
||||
callback: Some(shenlong_empty_callback),
|
||||
after: 0,
|
||||
user_data: ptr::null_mut()
|
||||
},
|
||||
PluginCallback {
|
||||
signal_name: c_str!("document-save").to_owned().into_raw(),
|
||||
//callback: Some(transmute(shenlong_document_save as usize)),
|
||||
callback: Some(shenlong_empty_callback),
|
||||
after: 0,
|
||||
user_data: ptr::null_mut()
|
||||
},
|
||||
PluginCallback {
|
||||
signal_name: c_str!("document-reload").to_owned().into_raw(),
|
||||
//callback: Some(transmute(shenlong_document_new as usize)),
|
||||
callback: Some(shenlong_empty_callback),
|
||||
after: 0,
|
||||
user_data: ptr::null_mut()
|
||||
},
|
||||
PluginCallback {
|
||||
signal_name: ptr::null(),
|
||||
callback: None,
|
||||
after: 0,
|
||||
user_data: ptr::null_mut()
|
||||
}
|
||||
];
|
||||
plugin_funcs.callbacks = plugin_callbacks.as_mut_ptr();*/
|
||||
|
||||
geany_plugin_register(plugin, 235, GEANY_API_VERSION as i32, GEANY_ABI_VERSION as i32);
|
||||
}
|
||||
println!("... shenlong module loaded");
|
||||
}
|
||||
|
23
src/main.rs
23
src/main.rs
@@ -14,16 +14,21 @@ fn main() {
|
||||
match args.next().as_ref().map(|arg| arg.as_str()) {
|
||||
Some("info") => println!("{:?}", project.info()),
|
||||
Some("where") => println!("{}", project.path().display()),
|
||||
Some("run") => {
|
||||
Command::new(args.next().unwrap())
|
||||
.args(args)
|
||||
.current_dir(project.path())
|
||||
.spawn()
|
||||
.expect("command failed to start")
|
||||
.wait()
|
||||
.expect("failed to wait on child");
|
||||
},
|
||||
Some("build") => execute_command_in_project(&project, project.project_type.build_command().into_iter()),
|
||||
Some("install") => execute_command_in_project(&project, project.project_type.install_command().into_iter()),
|
||||
Some("start") => execute_command_in_project(&project, project.project_type.run_command().into_iter()),
|
||||
Some("run") => execute_command_in_project(&project, args),
|
||||
Some(_) => println!("unrecognized command"),
|
||||
None => println!("{:?}", project)
|
||||
}
|
||||
}
|
||||
|
||||
fn execute_command_in_project<C: Iterator<Item=String>>(project: &scouter::Project, mut command: C) {
|
||||
Command::new(command.next().unwrap())
|
||||
.args(command)
|
||||
.current_dir(project.path())
|
||||
.spawn()
|
||||
.expect("command failed to start")
|
||||
.wait()
|
||||
.expect("failed to wait on child");
|
||||
}
|
||||
|
Reference in New Issue
Block a user