Skip to content

Commit

Permalink
Merge pull request #30 from TuringLang/project.toml
Browse files Browse the repository at this point in the history
Add `Project.toml`
  • Loading branch information
yebai authored Mar 9, 2019
2 parents 6b5a0ac + cd0c036 commit 11f023c
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 6 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ dkms.conf

# Projects files
Manifest.toml
Project.toml
deps/build.log
deps/deps.jl
deps/usr/
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ jobs:
- stage: test
script:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia -e 'using Pkg; Pkg.clone(pwd(), "Libtask"); Pkg.build("Libtask"); Pkg.test("Libtask"; coverage=true)'
- julia -e 'using Pkg; Pkg.build("Libtask"); Pkg.test("Libtask", coverage=true)'
# - julia -e 'using Pkg; cd(Pkg.dir("Libtask")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(process_folder())'
16 changes: 16 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name = "Libtask"
desc = "C shim for task copying in Turing"
uuid = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f"
repo = "https://github.com/TuringLang/Libtask.jl.git"
license = "MIT"
version = "0.2.6"

[deps]
BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Disclaimer: This feature is still experimental and should only be used with caut
## For Developer

### Release a new version
1. Write the new version number to $PROJECT_ROOT/VERSION;
1. Update the new version number in `Project.toml`;
2. Commit all the changes;
3. Tag the current commit with git, the tag name should be version number with a preceding "v";
4. Push the tag to the repo on GitHub.
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

14 changes: 13 additions & 1 deletion deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,17 @@ function include_build_script(version_str, try_prev=false)
include(build_script)
end

version_str = read(joinpath(@__DIR__, "../VERSION"), String) |> strip |> (x) -> lstrip(x, ['v'])
function get_version_str()
path = joinpath(@__DIR__, "../Project.toml")
version_reg = r"version\s*=\s*\"(.*)\""
open(path) do file
lines = readlines(file)
for line in lines
m = match(version_reg, line)
if isa(m, RegexMatch) return m.captures[1] end
end
end
end

version_str = get_version_str() |> strip |> (x) -> lstrip(x, ['v'])
include_build_script(version_str, true)
3 changes: 2 additions & 1 deletion deps/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using Pkg
using BinaryBuilder

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

# Collection of sources required to build Libtask
Expand Down

0 comments on commit 11f023c

Please sign in to comment.