Sublime Forum

OS specific Run configuration?

#1

I would like to create 4 build options for building Actionscript files. One for Building and one for Running in Linux, and the same for Windows.

Is it possible to do this?

Currently it seems ‘windows’ and ‘linux’ sections can only overwrite the default build option?

My current broken .sublime-build file is:

[code]{
“selector”: “source.actionscript”,

"windows":
{
    "cmd": 
        "${packages}\\User\\Flash-build.bat",
        "${project_path}",
        "${file}"
    ],

    "variants":
    
        {
            "name": "Run",
            "cmd": 
                "${packages}\\User\\Flash-run.bat",
                "${file_path}",
                "${file_base_name}"
            ]
        }
    ],
},

"linux":
{
    "cmd": 
        "${packages}/User/Flash-build.sh",
        "${packages}",
        "${project_path}",
        "${file_path}",
        "${file_base_name}"
    ],

    "variants":
    
        {
            "name": "Run",
            "cmd": 
                "${packages}/User/Flash-run.sh",
                "${packages}",
                "${project_path}",
                "${file_path}",
                "${file_base_name}"
            ]
        }
    ]
}

}
[/code]

0 Likes

#2

As this doesn’t seem possible I’ve added it to the UserEcho site.

0 Likes

#3

I think that this must work:

[code]{
“selector”: “source.actionscript”,

"windows":
{
    "cmd": 
        "${packages}\\User\\Flash-build.bat",
        "${project_path}",
        "${file}"
    ]
},
"linux":
{
    "cmd": 
        "${packages}/User/Flash-build.sh",
        "${packages}",
        "${project_path}",
        "${file_path}",
        "${file_base_name}"
    ]
},    

"variants":

    {
        "name": "Run",
        "windows": 
        {               
            "cmd": 
            "${packages}\\User\\Flash-run.bat",
            "${file_path}",
            "${file_base_name}"
            ]
        },
        "linux": 
        {               
            "cmd": 
            "${packages}/User/Flash-run.sh",
            "${packages}",
            "${project_path}",
            "${file_path}",
            "${file_base_name}"
            ]
        }
    }
]

}[/code]

0 Likes