How to better organize dub project to get 3 exe from same codebase?

Luis via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Feb 25 13:19:58 PST 2016


On Thursday, 25 February 2016 at 20:55:33 UTC, Suliman wrote:
> On Thursday, 25 February 2016 at 19:09:59 UTC, Suliman wrote:
>> Where to store shared classes?
>
> {
> 	"name": "123",
> 	"authors": [
> 		"Suliman"
> 	],
> 	"description": "A minimal D application.",
> 	"copyright": "Copyright © 2016, Suliman",
> 	"license": "proprietary",
> 	"subPackages": [
> 	{
> 		"name": "App1",
> 		"description": "App1",
> 		"targetType": "executable",
> 		"sourcePaths": ["source/App1"]
> 	},
> 	
> 	{
> 		"name": "App2",
> 		"description": "App2",
> 		"targetType": "executable",
> 		"sourcePaths": ["source/App2"]
> 	},	
> 	{
> 		"name": "App3",
> 		"description": "App3",
> 		"targetType": "executable",
> 		"sourcePaths": ["source/App3"]
> 	}	
> 	
> 	
> }
>
> Should I link from subPackages to general source/ folder ?

I don't link nothing. I have some shared D source code files 
between the 3 files (on src/dcpu). So each subpackage generates a 
executable file, excluding the not common files of the other 
subpackages. It isn't the best way of doing this, but just works 
for my case.
Eventually i would change this. I think that alphaPhobos does 
what you are asking : 
https://github.com/rikkimax/alphaPhobos/blob/master/dub.sdl


More information about the Digitalmars-d-learn mailing list