BowlerHatLLC / asconfigc

Command line utility that builds ActionScript projects configured with an asconfig.json file.
https://www.npmjs.com/package/asconfigc
Apache License 2.0
18 stars 5 forks source link

A target file must be specified #30

Closed hydroper closed 1 year ago

hydroper commented 1 year ago

Hey, there has been sometime I've not been using asconfigc. I don't know why I'm getting:

a target file must be specified.

Any idea? This is my asconfig.json:

{
    "config": "air",
    "type": "app",
    "mainClass": "Main",
    "compilerOptions": {
        "source-path": ["src"],
        "library-path": ["libs"],
        "output": "build/phantasy-star-3.swf"
    }
}

I did try adding compilerOptions.targets = ['SWF'], but still nothing.

hydroper commented 1 year ago

Also, here's src/Main.as:

package {
    import flash.display.Sprite;
    import com.matheusds365.phantasystar3.mainScenes.ComPresentScene;

    [SWF(width='1500', height='800', framerate='60', backgroundColor='#555')]
    public class Main extends Sprite {
        public function Main() {
            var scene:MainScene = new ComPresentScene;
            addChild(scene);
        }
    }
}

Also added reference to app.xml to the asconfig.json.

joshtynjala commented 1 year ago

Try adding --verbose to see more detailed output from asconfigc.

hydroper commented 1 year ago

Alright:

Configuration file: C:\Users\matheus-pc\Documents\adobe-air-projects\phantasy-star-3-enhanced\asconfig.json
Reading configuration file...
Parsing configuration file...
Validating configuration file...
Parsing configuration file...
SDK: C:\Dev\AIRSDK_Windows\AIRSDK_50.0.1.2
Processing Adobe AIR application descriptor(s)...
Initial window content: phantasystar3.swf
Descriptor: C:\Users\matheus-pc\Documents\adobe-air-projects\phantasy-star-3-enhanced\app.xml
Compiling application...
"C:\Program Files\OpenJDK\jdk-11.0.16.8-hotspot\bin\java.exe" -Dflexcompiler="C:\Dev\AIRSDK_Windows\AIRSDK_50.0.1.2" -Dflexlib="C:\Dev\AIRSDK_Windows\AIRSDK_50.0.1.2\frameworks" -jar "C:\Dev\AIRSDK_Windows\AIRSDK_50.0.1.2\lib\mxmlc-cli.jar" +flexlib="C:\Dev\AIRSDK_Windows\AIRSDK_50.0.1.2\frameworks" +configname=air --source-path+=src --library-path+=libs --output=build/phantasystar3.swf -- C:\Users\matheus-pc\Documents\adobe-air-projects\phantasy-star-3-enhanced\src\Main.as
Loading configuration: C:\Dev\AIRSDK_Windows\AIRSDK_50.0.1.2\frameworks\air-config.xml

291640 bytes written to C:\Users\matheus-pc\Documents\adobe-air-projects\phantasy-star-3-enhanced\build\phantasystar3.swf in 10.577 seconds

It works in the command line, but the VSCode intellisense doesn't work (I think it works with SWC projects, though).

hydroper commented 1 year ago

image

joshtynjala commented 1 year ago

Try replacing "mainClass": "Main" with this instead:

"files": [
    "src/Main.as"
]
hydroper commented 1 year ago

Solved, thanks!

joshtynjala commented 1 year ago

Interesting. I wonder why it was failing to resolve src/Main.as using mainClass. That definitely seems like a bug in vscode-as3mxml.