From be0e193c8606e8b2e0c05ed67317bd79f94a3b52 Mon Sep 17 00:00:00 2001 From: Joachim de Groot Date: Tue, 14 Nov 2017 23:03:11 +0100 Subject: [PATCH] Simplify building examples --- README.md | 2 +- dub.json | 23 +++++++++++++++++++-- examples/{samples_d/source => }/samples_d.d | 0 examples/samples_d/dub.json | 14 ------------- examples/{simple/source => }/simple.d | 0 examples/simple/dub.json | 14 ------------- 6 files changed, 22 insertions(+), 31 deletions(-) rename examples/{samples_d/source => }/samples_d.d (100%) delete mode 100644 examples/samples_d/dub.json rename examples/{simple/source => }/simple.d (100%) delete mode 100644 examples/simple/dub.json diff --git a/README.md b/README.md index 634407c..8a8b364 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ ATTENTION: the x86_64 version of the Linux library seems to be very unstable and the demo application crashed immediately upon startup. The x86 variant works almost fine, though. -To try the samples, change to examples/samples_d and run dub. +To try the samples, run `dub run -a x86 -c samples_d` The bindings are a strict port of the C API, so refer to libtcod documentation for more details. If I can get motivated, an object diff --git a/dub.json b/dub.json index a811cd7..d069451 100644 --- a/dub.json +++ b/dub.json @@ -5,11 +5,30 @@ "copyright": "Copyright © 2012, Bernard Helyer", "authors": ["Bernard Helyer", "Joachim de Groot"], "license": "BSD", - "targetType": "sourceLibrary", "copyFiles-linux-x86": ["libs/linux/x86/*"], "copyFiles-linux-x86_64": ["libs/linux/x86_64/*"], "copyFiles-windows-x86": ["libs/windows/x86/*"], "dependencies": { "derelict-util": "~>3.0.0-beta.2" - } + }, + "configurations": [ + { + "name": "default", + "targetType": "sourceLibrary" + }, + { + "name": "samples_d", + "mainSourceFile" : "examples/samples_d", + "targetName": "samples_d", + "targetType": "executable", + "targetPath": "bin" + }, + { + "name": "simple", + "mainSourceFile" : "examples/simple.d", + "targetName": "simple", + "targetType": "executable", + "targetPath": "bin" + } + ] } diff --git a/examples/samples_d/source/samples_d.d b/examples/samples_d.d similarity index 100% rename from examples/samples_d/source/samples_d.d rename to examples/samples_d.d diff --git a/examples/samples_d/dub.json b/examples/samples_d/dub.json deleted file mode 100644 index 59fd3c7..0000000 --- a/examples/samples_d/dub.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "samples_d", - "description": "Simpe example application for the libtcod-d library", - "homepage": "https://github.com/bhelyer/libtcod-d", - "authors": [ "Bernard Helyer" ], - "license": "BSD", - "dependencies": { - "libtcod-d": { "path": "../../" } - }, - "targetPath": "../../bin", - "targetType": "executable", - "targetName": "samples_d" -} - diff --git a/examples/simple/source/simple.d b/examples/simple.d similarity index 100% rename from examples/simple/source/simple.d rename to examples/simple.d diff --git a/examples/simple/dub.json b/examples/simple/dub.json deleted file mode 100644 index bce4035..0000000 --- a/examples/simple/dub.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "simple", - "description": "Simple example application for the libtcod-d library", - "homepage": "https://github.com/bhelyer/libtcod-d", - "authors": [ "Bernard Helyer" ], - "license": "BSD", - "dependencies": { - "libtcod-d": { "path": "../../" } - }, - "targetPath": "../../bin", - "targetType": "executable", - "targetName": "simple" -} -