Skip to content

Commit 5e679db

Browse files
committed
Updated .travis, appveyor, Project, and fix eval of __api__
1 parent ed74187 commit 5e679db

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

Diff for: .travis.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ julia:
77
- 0.6
88
- 0.7
99
- 1.0
10+
- 1.1
1011
- nightly
1112
notifications:
1213
email: false
@@ -31,7 +32,5 @@ git:
3132
script:
3233
- julia -e 'mit="ModuleInterfaceTools"; if VERSION < v"0.7.0-DEV.5183"; Pkg.clone(pwd()); Pkg.test(mit; coverage=true); else; import Pkg; using UUIDs; p = "Project.toml"; uuid = "5cb8414e-7aab-5a03-a681-351269c074bf"; write(p, replace(read(p, String), uuid => uuid4())); Pkg.update(); end; Pkg.test(;coverage=true)'
3334
after_success:
34-
# push coverage results to Coveralls
35-
- julia -e 'cd(Pkg.dir("ModuleInterfaceTools")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
36-
# push coverage results to Codecov
37-
- julia -e 'cd(Pkg.dir("ModuleInterfaceTools")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
35+
# push coverage results to Coveralls & Codecov
36+
- julia -e 'VERSION < v"0.7.0-DEV" || (using Pkg); cd(Pkg.dir("ModuleInterfaceTools")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder()); Codecov.submit(Codecov.process_folder())'

Diff for: Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ keywords = ["Packages", "API", "Modules"]
44
license = "MIT"
55
desc = "Macro to help manage module and package APIs"
66
authors = ["ScottPJones <[email protected]>"]
7-
version = "0.1.7"
7+
version = "0.1.8"
88

99
[deps]
1010

Diff for: appveyor.yml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ environment:
33
- julia_version: 0.6
44
- julia_version: 0.7
55
- julia_version: 1.0
6+
- julia_version: 1.1
67
- julia_version: latest
78

89
platform:

Diff for: src/ModuleInterfaceTools.jl

+8-6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Licensed under MIT License, see LICENSE.md
1111
module ModuleInterfaceTools
1212

1313
const debug = Ref(false)
14+
const showeval = Ref(false)
1415

1516
const V6_COMPAT = VERSION < v"0.7-"
1617
const BIG_ENDIAN = (ENDIAN_BOM == 0x01020304)
@@ -78,6 +79,7 @@ end
7879

7980
function m_eval(mod, expr)
8081
try
82+
showeval[] && println("m_eval($mod, $expr)")
8183
Core.eval(mod, expr)
8284
catch ex
8385
println("m_eval($mod, $expr)");
@@ -252,13 +254,13 @@ function _add_symbols(curmod, grp, exprs)
252254
end
253255

254256
has_api(mod) = isdefined(mod, :__api__)
255-
get_api(mod) = m_eval(mod, :__api__)
257+
get_api(curmod, mod) = m_eval(curmod, :( $mod.__api__ ))
256258

257259
function _api_extend(curmod, modules, cpy::Bool)
258260
for nam in modules
259261
mod = m_eval(curmod, nam)
260262
if has_api(mod)
261-
api = get_api(mod)
263+
api = get_api(curmod, mod)
262264
_do_list(curmod, cpy, :import, Base, :Base, :base, api)
263265
_do_list(curmod, cpy, :import, mod, nam, :public!, api)
264266
_do_list(curmod, cpy, :import, mod, nam, :develop!, api)
@@ -275,7 +277,7 @@ function _api_use(curmod, modules, cpy::Bool)
275277
for nam in modules
276278
mod = m_eval(curmod, nam)
277279
if has_api(mod)
278-
api = get_api(mod)
280+
api = get_api(curmod, mod)
279281
_do_list(curmod, cpy, :using, mod, nam, :public, api)
280282
_do_list(curmod, cpy, :using, mod, nam, :public!, api)
281283
else
@@ -288,9 +290,8 @@ end
288290
function _api_export(curmod, modules)
289291
for nam in modules
290292
mod = m_eval(curmod, nam)
291-
api = get_api(mod)
292293
if has_api(mod)
293-
api = get_api(mod)
294+
api = get_api(curmod, mod)
294295
m_eval(curmod, Expr( :export, getfield(api, :modules)...))
295296
m_eval(curmod, Expr( :export, getfield(api, :public)...))
296297
m_eval(curmod, Expr( :export, getfield(api, :public!)...))
@@ -354,7 +355,8 @@ function _api(curmod::Module, cmd::Symbol, exprs)
354355
for nam in modules
355356
mod = m_eval(curmod, nam)
356357
if has_api(mod)
357-
for sym in getfield(get_api(mod), :modules)
358+
api = get_api(curmod, mod)
359+
for sym in getfield(api, :modules)
358360
if isdefined(mod, sym)
359361
m_eval(curmod, :(using $nam.$sym))
360362
cpy && m_eval(curmod, :( push!(__tmp_api__.modules, $(QuoteNode(sym)) )))

0 commit comments

Comments
 (0)