Skip to content

Commit

Permalink
Merge pull request #612 from WebFreak001/common-subpackage
Browse files Browse the repository at this point in the history
Move dcd.common into separate subpackage
merged-on-behalf-of: Jan Jurzitza <gh@webfreak.org>
  • Loading branch information
dlang-bot authored May 1, 2020
2 parents 339d38f + 3e2c0c6 commit f22b193
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 14 deletions.
7 changes: 7 additions & 0 deletions common/dub.sdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name "common"
stringImportPaths "../bin"
preGenerateCommands "rdmd \"$PACKAGE_DIR/dubhash.d\""
sourcePaths "src"
importPaths "src"

dependency "msgpack-d" version="~>1.0.0-beta.7"
4 changes: 2 additions & 2 deletions dubhash.d → common/dubhash.d
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import std.string;
void main()
{
auto dir = environment.get("DUB_PACKAGE_DIR");
auto hashFile = dir.buildPath("bin", "dubhash.txt");
auto hashFile = dir.buildPath("..", "bin", "dubhash.txt");
auto gitVer = executeShell("git -C " ~ dir ~ " describe --tags");
auto ver = (gitVer.status == 0 ? gitVer.output.strip
: "v" ~ dir.dirName.baseName.findSplitAfter(
environment.get("DUB_ROOT_PACKAGE") ~ "-")[1]).ifThrown("0.0.0")
.chain(newline).to!string.strip;
dir.buildPath("bin").mkdirRecurse;
dir.buildPath("..", "bin").mkdirRecurse;
if (!hashFile.exists || ver != hashFile.readText.strip)
hashFile.write(ver);
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion constants-gen/generator.d
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ immutable ConstantCompletion[] traits = [

string part3 = "];";

auto file = File("../src/dcd/common/constants2.d", "w");
auto file = File("../common/src/dcd/common/constants2.d", "w");
file.writeln(part1);
foreach (pragma_; pragmas.sorted)
file.writeln('\t', pragma_, ",");
Expand Down
13 changes: 4 additions & 9 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
"dependencies": {
"dsymbol": "~>0.9.0",
"libdparse": "~>0.13.0",
"msgpack-d": "~>1.0.0-beta.7",
":common": "*",
"stdx-allocator": "~>2.77.5",
"emsi_containers": "~>0.8.0-alpha.15"
},
"stringImportPaths" : [
"bin"
],
"subPackages": ["common"],
"versions": ["built_with_dub"],
"configurations": [
{
Expand All @@ -29,7 +27,7 @@
{
"name": "client",
"targetType": "executable",
"targetPath": "bin/",
"targetPath": "bin/",
"targetName": "dcd-client",
"excludedSourceFiles": [
"src/dcd/server/*"
Expand All @@ -38,14 +36,11 @@
{
"name": "server",
"targetType": "executable",
"targetPath": "bin/",
"targetPath": "bin/",
"targetName": "dcd-server",
"excludedSourceFiles": [
"src/dcd/client/*"
]
}
],
"preGenerateCommands" : [
"rdmd \"$PACKAGE_DIR/dubhash.d\""
]
}
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ clean:
rm -f *.o

CLIENT_SRC := \
$(shell find src/dcd/common -name "*.d")\
$(shell find common/src/dcd/common -name "*.d")\
$(shell find src/dcd/client -name "*.d")\
$(shell find msgpack-d/src/ -name "*.d")

Expand Down Expand Up @@ -62,7 +62,7 @@ override LDC_CLIENT_FLAGS += $(DFLAGS)
override GDC_CLIENT_FLAGS += $(DFLAGS)

SERVER_SRC := \
$(shell find src/dcd/common -name "*.d")\
$(shell find common/src/dcd/common -name "*.d")\
$(shell find src/dcd/server -name "*.d")\
$(shell find ${DSYMBOL_DIR}/src -name "*.d")\
$(shell find ${STDXALLOC_DIR}/source -name "*.d")\
Expand Down

0 comments on commit f22b193

Please sign in to comment.