Pure-D / code-d

Fully featured D language extension for Visual Studio Code using Serve-D
MIT License
297 stars 47 forks source link

Builder can't detect a nested dub sub-package #392

Open aubade opened 2 years ago

aubade commented 2 years ago

I've got a complicated dub definition file for my project that I'm trying to get code-d to cooperate with.

{
    "name" : "ice-engine",
    "description" : "The Identity Crisis Engine",
    "homepage" : "<redacted>",
    "copyright" : "Copyright �2013-2014, <redacted>",
    "license": "proprietary",
    "workingDirectory":".",
    "targetPath":"bin",
    "targetType":"none",
    "importPaths": ["Libraries", "Libraries/misc", "Engine", "Vanilla", "TestApps", "ICE"],
    "sourcePaths": ["Libraries/misc"],
    "copyFiles-windows": ["extlibs\\dsfmlc-audio-2.dll", "extlibs\\dsfmlc-graphics-2.dll", "extlibs\\dsfmlc-window-2.dll",
                            "extlibs\\dsfmlc-system-2.dll", "extlibs\\openal32.dll", "extlibs\\libsndfile-1.dll",
                            "extlibs\\libmodplug.dll", "extlibs\\physfs.dll", "extlibs\\lua51.dll",
                            "extlibs\\libgcc_s_dw2-1.dll", "extlibs\\libstdc++-6.dll", "extlibs\\libwinpthread-1.dll"
    ],
    "subPackages":[
        "./Engine/spqr",
        "./Engine/sundery",
        "./Engine/grap",
        "./Engine/phil",
        "./Engine/echo",
        "./Engine/wander",
        "./Engine/tiler",
        "./Engine/yui",
        "./Engine/assetman",
        "./Engine/scrip",
        "./Engine/brain",
        "./Vanilla/",
        "./ICE/",
        {
            "name":"enginetest",
            "targetType":"executable",  
            "targetName":"ICE-test",
            "targetPath":"bin",
            "dependencies": {
                "ice-engine:spqr":"*",
                "ice-engine:sundery":"*",
                "ice-engine:phil":"*",
                "ice-engine:grap":"*",
                "ice-engine:echo":"*",
                "ice-engine:wander":"*",
                "ice-engine:tiler":"*",
                "ice-engine:yui":"*",
                "ice-engine:scrip":"*",
                "ice-engine:assetman":"*",
                "ice-engine:brain":"*"
            },
            "configurations": [
                {
                    "name":"standard"
                },
                {
                    "name":"nothread",
                    "subConfigurations":{
                        "ice-engine:spqr":"nothread",
                        "ice-engine:sundery":"nothread",
                        "ice-engine:phil":"nothread",
                        "ice-engine:grap":"nothread",
                        "ice-engine:echo":"nothread",
                        "ice-engine:wander":"nothread",
                        "ice-engine:tiler":"nothread",
                        "ice-engine:yui":"nothread",
                        "ice-engine:scrip":"nothread",
                        "ice-engine:assetman":"nothread",
                        "ice-engine:brain":"nothread"
                    }
                }
            ],
            "buildTypes": {
                "profile": {
                    "buildRequirements":["allowWarnings"],
                    "buildOptions": ["debugInfo","releaseMode", "optimize", "inline", "noBoundsCheck", "profile"],
                    "dflags-gdc":["-pg"],
                    "libs-posix-gdc":["c_p"]
                },
                "debug": {
                    "buildOptions": ["debugInfo", "debugMode","alwaysStackFrame"]
                },
                "debug-optimize": {
                    "buildOptions": ["debugInfo", "debugMode",  "alwaysStackFrame", "optimize", "inline"]
                },
                "release":{
                    "lflags-windows-x86-dmd": ["/SUBSYSTEM:WINDOWS"],
                    "buildOptions": ["releaseMode", "optimize", "inline", "noBoundsCheck"]
                },
                    "release-symbols":{
                    "lflags-windows-x86-dmd": ["/SUBSYSTEM:WINDOWS"],
                    "buildOptions": ["debugInfo","releaseMode", "optimize", "inline", "noBoundsCheck"]
                }
            },                  
            "lflags-windows-x86-dmd":["/LIBPATH:..\\extlibs\\coff","/LIBPATH:.\\extlibs\\coff","..\\DSFMLC\\build\\lib"],
            "lflags-windows-ldc":["-L.\\extlibs\\coff"],
            "sourceFiles":["TestApps/testcode2.d"],
            "versions":["EngineTest", "fpfloat"]
        }
    ],
    "buildTypes": {
        "profile": {
            "buildRequirements":["allowWarnings"],
            "buildOptions": ["debugInfo","releaseMode", "optimize", "inline", "noBoundsCheck", "profile"],
            "dflags-gdc":["-pg"],
            "libs-posix-gdc":["c_p"]
        },
        "debug": {
            "buildOptions-windows": ["debugInfo","debugMode","alwaysStackFrame", "stackStomping"]
        },
        "debug-optimize": {
            "buildOptions": ["debugMode", "debugInfo", "alwaysStackFrame", "stackStomping", "optimize", "inline"]
        },
        "release":{
            "lflags-windows-x86-dmd": ["/SUBSYSTEM:WINDOWS"],
            "buildOptions": ["releaseMode", "optimize", "inline", "noBoundsCheck"]
        },
        "release-symbols":{
            "lflags-windows-x86-dmd": ["/SUBSYSTEM:WINDOWS"],
            "buildOptions": ["debugInfo","releaseMode", "optimize", "inline", "noBoundsCheck"]
        }

    }
}

(visible in context at https://bitbucket.org/aubade/ice/src if such is important)

Either way, the important thing at the moment is to be able to build the "enginetest" subpackage. Unfortunately, code-d sees all the subpackages except the bottom two ("./ICE", and the nested EngineTest subpackage)

I've tried taking one of the tasks it does support and just modifying that but there seems to be no way for a tasks.json to specify to dub which module needs building. (i.e. "dub build ice:enginetest")

WebFreak001 commented 2 years ago

I think as a workaround you should be able to use "dub_args": [":enginetest"] in your custom config for now