tuse Compat.Sys for version-independent system checks - Granular.jl - Julia pac… | |
git clone git://src.adamsgaard.dk/Granular.jl | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit d07cf4a11cda63a0d7a0b342787721cb27c02e6e | |
parent 34985c227ef815ae8c6d65e0ceceaec7e69009d4 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Thu, 9 Nov 2017 10:58:39 -0600 | |
use Compat.Sys for version-independent system checks | |
Diffstat: | |
M deps/build.jl | 6 +++--- | |
M src/atmosphere.jl | 6 +----- | |
M src/grain.jl | 7 +------ | |
M src/grid.jl | 3 +-- | |
M src/ocean.jl | 6 +----- | |
M test/runtests.jl | 7 +------ | |
M test/vtk.jl | 7 ++++--- | |
7 files changed, 12 insertions(+), 30 deletions(-) | |
--- | |
diff --git a/deps/build.jl b/deps/build.jl | |
t@@ -1,6 +1,6 @@ | |
#!/usr/bin/env julia | |
using BinDeps | |
-using Compat | |
+import Compat.Sys | |
@BinDeps.setup | |
t@@ -10,7 +10,7 @@ provides(AptGet, "imagemagick", imagemagick, os = :Linux) | |
provides(Yum, "ImageMagick", imagemagick, os = :Linux) | |
provides(Pacman, "imagemagick", imagemagick, os = :Linux) | |
-if is_apple() | |
+if Compat.Sys.isapple() | |
if Pkg.installed("Homebrew") === nothing | |
error("Homebrew julia package not installed, " * | |
"please run Pkg.add(\"Homebrew\")") | |
t@@ -18,7 +18,7 @@ if is_apple() | |
using Homebrew | |
provides(Homebrew.HB, "imagemagick", imagemagick, os = :Darwin) | |
-elseif is_windows() | |
+elseif Compat.Sys.iswindows() | |
using WinRPM | |
provides(WinRPM.RPM, "imagemagick", imagemagick, os = :Windows) | |
end | |
diff --git a/src/atmosphere.jl b/src/atmosphere.jl | |
t@@ -1,8 +1,4 @@ | |
-if VERSION < v"0.7.0-DEV.2004" | |
- using Base.Test | |
-else | |
- using Test | |
-end | |
+using Compat.Test | |
export createEmptyAtmosphere | |
"Returns empty ocean type for initialization purposes." | |
diff --git a/src/grain.jl b/src/grain.jl | |
t@@ -1,10 +1,5 @@ | |
## Manage grains in the model | |
-using Compat | |
-if VERSION < v"0.7.0-DEV.2004" | |
- using Base.Test | |
-else | |
- using Test | |
-end | |
+using Compat.Test | |
hasPyPlot = false | |
if typeof(Pkg.installed("PyPlot")) == VersionNumber | |
diff --git a/src/grid.jl b/src/grid.jl | |
t@@ -534,7 +534,6 @@ function findEmptyPositionInGridCell(simulation::Simulatio… | |
nx, ny = size(grid.xh) | |
- i_iter=0 | |
for i_iter=1:n_iter | |
overlap_found = false | |
t@@ -585,7 +584,7 @@ function findEmptyPositionInGridCell(simulation::Simulatio… | |
end | |
end | |
if verbose && overlap_found == false | |
- info("Found position $pos in cell $i,$j after $i_iter iterations") | |
+ info("Found position $pos in cell $i,$j") | |
elseif verbose && overlap_found | |
info("Free position not found in cell $i,$j") | |
end | |
diff --git a/src/ocean.jl b/src/ocean.jl | |
t@@ -1,8 +1,4 @@ | |
-if VERSION < v"0.7.0-DEV.2004" | |
- using Base.Test | |
-else | |
- using Test | |
-end | |
+using Compat.Test | |
export createEmptyOcean | |
"Returns empty ocean type for initialization purposes." | |
diff --git a/test/runtests.jl b/test/runtests.jl | |
t@@ -1,9 +1,4 @@ | |
-using Compat | |
-if VERSION < v"0.7.0-DEV.2004" | |
- using Base.Test | |
-else | |
- using Test | |
-end | |
+using Compat.Test | |
import Granular | |
include("grain.jl") | |
diff --git a/test/vtk.jl b/test/vtk.jl | |
t@@ -1,4 +1,5 @@ | |
#!/usr/bin/env julia | |
+import Compat | |
# Check the contact search and geometry of a two-particle interaction | |
t@@ -13,11 +14,11 @@ Granular.findContacts!(sim, method="all to all") | |
Granular.writeVTK(sim, verbose=false) | |
cmd_post = "" | |
-if is_linux() | |
+if Compat.Sys.islinux() | |
cmd = "sha256sum" | |
-elseif is_apple() | |
+elseif Compat.Sys.isapple() | |
cmd = ["shasum", "-a", "256"] | |
-elseif is_windows() | |
+elseif Compat.Sys.iswindows() | |
info("checksum verification not yet implemented on Windows") | |
exit() | |
cmd = ["powershell", "-Command", "\"Get-FileHash", "-Algorithm", "SHA256"] |