Skip to content

Commit 11f023c

Browse files
authored
Merge pull request #30 from TuringLang/project.toml
Add `Project.toml`
2 parents 6b5a0ac + cd0c036 commit 11f023c

File tree

7 files changed

+33
-6
lines changed

7 files changed

+33
-6
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ dkms.conf
5353

5454
# Projects files
5555
Manifest.toml
56-
Project.toml
5756
deps/build.log
5857
deps/deps.jl
5958
deps/usr/

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ jobs:
5353
- stage: test
5454
script:
5555
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
56-
- julia -e 'using Pkg; Pkg.clone(pwd(), "Libtask"); Pkg.build("Libtask"); Pkg.test("Libtask"; coverage=true)'
56+
- julia -e 'using Pkg; Pkg.build("Libtask"); Pkg.test("Libtask", coverage=true)'
5757
# - julia -e 'using Pkg; cd(Pkg.dir("Libtask")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(process_folder())'

Project.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name = "Libtask"
2+
desc = "C shim for task copying in Turing"
3+
uuid = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f"
4+
repo = "https://github.com/TuringLang/Libtask.jl.git"
5+
license = "MIT"
6+
version = "0.2.6"
7+
8+
[deps]
9+
BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
10+
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
11+
12+
[extras]
13+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
14+
15+
[targets]
16+
test = ["Test"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Disclaimer: This feature is still experimental and should only be used with caut
8181
## For Developer
8282

8383
### Release a new version
84-
1. Write the new version number to $PROJECT_ROOT/VERSION;
84+
1. Update the new version number in `Project.toml`;
8585
2. Commit all the changes;
8686
3. Tag the current commit with git, the tag name should be version number with a preceding "v";
8787
4. Push the tag to the repo on GitHub.

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

deps/build.jl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,17 @@ function include_build_script(version_str, try_prev=false)
1818
include(build_script)
1919
end
2020

21-
version_str = read(joinpath(@__DIR__, "../VERSION"), String) |> strip |> (x) -> lstrip(x, ['v'])
21+
function get_version_str()
22+
path = joinpath(@__DIR__, "../Project.toml")
23+
version_reg = r"version\s*=\s*\"(.*)\""
24+
open(path) do file
25+
lines = readlines(file)
26+
for line in lines
27+
m = match(version_reg, line)
28+
if isa(m, RegexMatch) return m.captures[1] end
29+
end
30+
end
31+
end
32+
33+
version_str = get_version_str() |> strip |> (x) -> lstrip(x, ['v'])
2234
include_build_script(version_str, true)

deps/build_tarballs.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Note that this script can accept some limited command-line arguments, run
22
# `julia build_tarballs.jl --help` to see a usage message.
3+
using Pkg
34
using BinaryBuilder
45

56
name = "LibtaskDylib"
6-
version_str = read(joinpath(@__DIR__, "../VERSION"), String) |> strip |> (x) -> lstrip(x, ['v'])
7+
version_str = Pkg.TOML.parsefile(joinpath(@__DIR__, "../Project.toml"))["version"] |> strip |> (x) -> lstrip(x, ['v'])
78
version = VersionNumber(version_str)
89

910
# Collection of sources required to build Libtask

0 commit comments

Comments
 (0)