You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by OK <po...@olafkrueger.net> on 2016/09/09 11:12:41 UTC

[FlexJS] Creating swc libs from source

Hi,
I'll probably have some time at the weekend so I would like to continue my
work on a little FlexJS PureMVC demo.
Are there're any news/changes on how to create an swc from the as3 source
files using FlexJS?

Thanks,
Olaf




--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Creating-swc-libs-from-source-tp55018.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Creating swc libs from source

Posted by Josh Tynjala <jo...@gmail.com>.
I got a little confused the first time I tried it, and I didn't get a SWC.
Let's hope someone can find the time to figure that out. It'll really make
distributing libraries easier.

- Josh

On Sep 10, 2016 10:07 PM, "Alex Harui" <ah...@adobe.com> wrote:

>
>
> On 9/10/16, 12:27 AM, "OK" <po...@olafkrueger.net> wrote:
>
> >Alex Harui wrote
> >> Building framework SWCs will almost always be the two-step process,
> >> although the pattern we are using is a bit different now than what Josh
> >> describes below.
> >
> >Does that mean that there is currently no, or no reasonable way to build a
> >swc package for deployment?
>
> I think the way we are doing it is "reasonable", but it could be easier if
> COMPJSC knew how to inject the output into a SWC.
> To see how it is done, check out the Ant build for any of the framework
> SWCs.
>
> -Alex
>
>

Re: [FlexJS] Creating swc libs from source

Posted by Alex Harui <ah...@adobe.com>.

On 9/10/16, 12:27 AM, "OK" <po...@olafkrueger.net> wrote:

>Alex Harui wrote
>> Building framework SWCs will almost always be the two-step process,
>> although the pattern we are using is a bit different now than what Josh
>> describes below.
>
>Does that mean that there is currently no, or no reasonable way to build a
>swc package for deployment?

I think the way we are doing it is "reasonable", but it could be easier if
COMPJSC knew how to inject the output into a SWC.
To see how it is done, check out the Ant build for any of the framework
SWCs.

-Alex


Re: [FlexJS] Creating swc libs from source

Posted by OK <po...@olafkrueger.net>.
Alex Harui wrote
> It should use the same workflow as any other traditional Flex SWC.

I thought I've tried that with no success in the past but doing it again now
it just works!
As harbs said PureMVC is pure AS3 and it compiles without any problems.


Alex Harui wrote
> Building framework SWCs will almost always be the two-step process,
> although the pattern we are using is a bit different now than what Josh
> describes below. 

Does that mean that there is currently no, or no reasonable way to build a
swc package for deployment?

Thanks,
Olaf








--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Creating-swc-libs-from-source-tp55018p55046.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Creating swc libs from source

Posted by Alex Harui <ah...@adobe.com>.
Hopefully, there are two kinds of SWCs in FlexJS: framework SWCs and
application SWCs.

Building framework SWCs will almost always be the two-step process,
although the pattern we are using is a bit different now than what Josh
describes below.  Framework SWCs are likely to have different dependencies
such as dependencies on Flash vs browser APIS, and the code going into the
SWC may have different APIs based on those dependencies.  Everything in
the FlexJS SDK is a framework SWC.

I don't think anybody has tried it yet, but an application SWC is just a
reusable library of a subset of an application.  It should use the same
workflow as any other traditional Flex SWC.  For example, in Flash
Builder, you would create a Flex Library Project and produce a SWC.  Then
you would run the FlexJS COMPC tool to generate the JS files.  Then when
you build your application in FlexJS, the FlexJS compiler should be able
to find the JS files by checking the library path. If that doesn't work,
we should fix it.

Packaging up an application SWC for deployment is trickier and currently
requires setting things up like a framework SWC, but maybe someday the
FalconJX COMPC will learn how to inject JS into a SWC.

If PureMVC has no Flash dependencies, it is a candidate to be an
application SWC.

Thanks,
-Alex

On 9/9/16, 8:02 AM, "Josh Tynjala" <jo...@gmail.com> wrote:

>The last time I tried building a SWC for JS, it was a two-step process.
>
>1) Use js/bin/compc or js/bin/asjscompc (depending on your needs) to
>generate the JS files. Looking over my build script, I output the JS files
>in a js/src directory so that they'd have the right directory structure to
>just copy them into the SWC:
>
>-output=temp-js-bin/js/src
>
>2) Use bin/compc to create the SWC from the same source code. You may need
>to play around with the compiler arguments so that the
>external-library-path and things are the same as when you generated the
>JS.
>bin/compc is usually for generating a SWF for Flash Player, so it doesn't
>necessarily include the same libraries by default. If you used asjscompc,
>for instance, you'll definitely need to tell bin/compc to use
>js/libs/js.swc. You also want to include the JS files that we put in
>temp-js-bin in step 1:
>
>-include-file+=js/src/*,temp-js-bin/js/src/*
>
>- Josh
>
>On Fri, Sep 9, 2016 at 4:52 AM, OK <po...@olafkrueger.net> wrote:
>
>> Harbs wrote
>> > FWIW, I’m using PureMVC in my FlexJS application. I just copied the
>> source
>> > files to my project and it “just works”.
>>
>> I'm already doing this the same way and it works for me to ;-)
>> I'd like to publish a simple FlexJS PureMVC demo and for this purpose it
>> would be nice to provide PureMVC as swc file.
>> But of course if creating and using a swc would be to complicated or
>>take
>> to
>> much time I'd invest my time rather in finishing the demo for now;-)
>>
>> Thanks,
>> Olaf
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context: http://apache-flex-
>> development.2333347.n4.nabble.com/FlexJS-Creating-swc-libs-
>> from-source-tp55018p55020.html
>> Sent from the Apache Flex Development mailing list archive at
>>Nabble.com.
>>


Re: [FlexJS] Creating swc libs from source

Posted by Josh Tynjala <jo...@gmail.com>.
The last time I tried building a SWC for JS, it was a two-step process.

1) Use js/bin/compc or js/bin/asjscompc (depending on your needs) to
generate the JS files. Looking over my build script, I output the JS files
in a js/src directory so that they'd have the right directory structure to
just copy them into the SWC:

-output=temp-js-bin/js/src

2) Use bin/compc to create the SWC from the same source code. You may need
to play around with the compiler arguments so that the
external-library-path and things are the same as when you generated the JS.
bin/compc is usually for generating a SWF for Flash Player, so it doesn't
necessarily include the same libraries by default. If you used asjscompc,
for instance, you'll definitely need to tell bin/compc to use
js/libs/js.swc. You also want to include the JS files that we put in
temp-js-bin in step 1:

-include-file+=js/src/*,temp-js-bin/js/src/*

- Josh

On Fri, Sep 9, 2016 at 4:52 AM, OK <po...@olafkrueger.net> wrote:

> Harbs wrote
> > FWIW, I’m using PureMVC in my FlexJS application. I just copied the
> source
> > files to my project and it “just works”.
>
> I'm already doing this the same way and it works for me to ;-)
> I'd like to publish a simple FlexJS PureMVC demo and for this purpose it
> would be nice to provide PureMVC as swc file.
> But of course if creating and using a swc would be to complicated or take
> to
> much time I'd invest my time rather in finishing the demo for now;-)
>
> Thanks,
> Olaf
>
>
>
>
>
>
> --
> View this message in context: http://apache-flex-
> development.2333347.n4.nabble.com/FlexJS-Creating-swc-libs-
> from-source-tp55018p55020.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>

Re: [FlexJS] Creating swc libs from source

Posted by OK <po...@olafkrueger.net>.
Harbs wrote
> FWIW, I’m using PureMVC in my FlexJS application. I just copied the source
> files to my project and it “just works”.

I'm already doing this the same way and it works for me to ;-)
I'd like to publish a simple FlexJS PureMVC demo and for this purpose it
would be nice to provide PureMVC as swc file.
But of course if creating and using a swc would be to complicated or take to
much time I'd invest my time rather in finishing the demo for now;-)

Thanks,
Olaf  






--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Creating-swc-libs-from-source-tp55018p55020.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] Creating swc libs from source

Posted by Harbs <ha...@gmail.com>.
FWIW, I’m using PureMVC in my FlexJS application. I just copied the source files to my project and it “just works”.

On Sep 9, 2016, at 2:12 PM, OK <po...@olafkrueger.net> wrote:

> Hi,
> I'll probably have some time at the weekend so I would like to continue my
> work on a little FlexJS PureMVC demo.
> Are there're any news/changes on how to create an swc from the as3 source
> files using FlexJS?
> 
> Thanks,
> Olaf
> 
> 
> 
> 
> --
> View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Creating-swc-libs-from-source-tp55018.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.