Flex/AS3, multiple projects, different SDKs

I work with multiple AS3/Flex applications. Every now and then I need to switch between projects and here's the catch: A lot of the modules are compatible with older versions of the Flex SDK but some of them are SDK specific. The modules are preferably compiled with the same SDK per project. See example below.

Module 1 (compatible SDKs 4.6.0-4.14.1)
Module 2 (compatible SDKs 4.6.0-4.14.1)
Module 3 (compatible SDKs 4.6.0 only)
Module 4 (compatible SDKs 4.14.1 only)

Project A, Compiled with SDK: 4.6.0
- Module 1
- Module 2
- Module 3

Project B, Compiled with SDK: 4.14.1
- Module 1
- Module 2
- Module 4

Project SDK seem to be supported by IntelliJ since there is a Project SDK selector under Project in Project Structure, Project Settings.
Setting the Project SDK unfortunately seem to have no effect - regardless of Project SDK setting, I have to specify the SDK for each module in which case the Project SDK is ignored. Is this a bug or is it me doing something wrong?

For now I am stuck with a cumbersome workaround creating an SDK under Platform settings called "SharedSDK". Every module then refers to "SharedSDK". The path of "SharedSDK" is finally changed manually when I switch project. Fairly inconvenient.. (besides that, there are a few bugs when changing the sdk path but that's another topic).

Comment actions Permalink

Sorry for delay.
You are right, unfortunately Project SDK is not supported for Flash/Flex projects. Tracked as https://youtrack.jetbrains.com/issue/IDEA-84951.
Switching SharedSDK path is probably the best workaround I can suggest. BTW what are bugs with changing SDK path?
Or may be even easier workaround: configure SharedSDK1 and SharedSDK2 and when you switch projects - rename one of them to SharedSDK.

Comment actions Permalink

Renaming SDK causes all projects using that SDK to also rename the SDK reference. So SharedSDK1/2 wouldn't work. Bear in mind that the workspace settings are stored in SVN - project should be ready to compile as stored in source management.

Problems changing SDK. IDEA 14.1.2
I open Project A (compiles w. SDK 4.14.1)
It compiles and runs
I open Project B (compiles w. SDK 4.6.0)
I open Project Structure F12
Click SDKs
Find SharedSDK
Click [...]
Change to SDK 4.6.0 SDK folder.
Click OK
SDK automatically renames itself 4.6.0
*(workaround here)
I rename it ProjectSDK
I click OK.

I compile the project and get
Error:(1, 1) [xlib]: The definition of base class Object was not found.
This indicates that the SDK was not properly set.

Click OK
Hit F12 again
Find and rename SDK 4.6.0 -> ProjectSDK
Click OK
I compile the project and it runs.


Please sign in to leave a comment.