You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Pat Deegan <pa...@psychogenic.com> on 2018/01/06 02:37:24 UTC

Linux Platform Integration Alpha (Api.js etc)

Aloha,

Ok, so it's still a bit rough around the edges but I've got a
linux/coraline platform running (and a few related questions).

It's available at https://github.com/psychogenic/cordova-linux.git

Assuming you have:
	- a linux box,
	- cordova,
	- cmake/cpack (https://cmake.org/),
	- coraline (https://coraline.psychogenic.com)
	and some way to build linux bundles (I've got debuild and alien)

You should be able to do:

$ cordova create SomeApp com.example.someapp SomeApp
$ cd SomeApp
$ cordova platform add https://github.com/psychogenic/cordova-linux.git
$ cordova build

And wind up with some interesting files in
	...SomeApp/platforms/cordova-linux/packages

What I get in there:
 someapp_1.0.0.deb
 someapp_1.0.0.rpm
 someapp_1.0.0.zip

with all the right stuff within (at least for the deb, can't really test
the RPMs and don't know how to setup their dependencies etc).

The name of the bundles/content directory is generated from the id
(bla.bla.thiswillbethename), the versions are taken from the config
file, etc.  So everything (hopefully) works as you'd expect.


*** 4 Questions ***

* 1) by what magic do the other platforms get nice names?
The android platform, for instance, has seems to have "name":
"cordova-android" but `platform ls` shows:

$ cordova platform ls
Installed platforms:
  cordova-linux 0.0.6
Available platforms:
  android ~7.0.0
  browser ~5.0.1
  ios ~4.5.4
  osx ~4.0.1
  windows ~5.0.0
  www ^3.12.0

I can't bring myself to call my package "linux" (!) but why is it called
"cordova-linux" in the listing?

* 2) how am I supposed to use Api.prototype.requirements?  The test
sample doesn't make it obvious.  I'd like to ensure cmake and coraline
are actually installed.

* 3) how do we throw CordovaError?  The system barfs in an ugly way when
I do so.

* 4) at this time, I've elected to preserve older packages in that
output directory (.../cordova-linux/packages).  So if you
	cordova clean
the build directories and all that go away, but the various versions of
bundles/zip files are preserved unless you do a `platform rm`.  Is


*** Further Improvements ***

So, if this is a good start and it's likely to get included, I'll do a
little more legwork on the plugins side to ensure the bundles have any
plugins requested as dependencies, and such.

I'd also like to know if there's anything I'm not doing correctly or
should otherwise change to be more compliant with expectations.

Also, if anyone is capable of testing on an RPM-based distro, that'd be
cool as I'm flying completely blind in this department for the moment.

Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: Linux Platform Integration Alpha (Api.js etc)

Posted by julio cesar sanchez <jc...@gmail.com>.
That ugly message is caused probably by Cordova lib, I think we "broke"
something when switching from a pinned npm to the system one, all the
errors are appearing like that now.

2018-01-16 3:08 GMT+01:00 Shazron <sh...@gmail.com>:

> 3. Promises, ugh. Try reject OR throw, not both.
> https://github.com/psychogenic/cordova-linux/blob/
> 69a4dc92cae54e86761ad286c38710df8693b244/src/cordova/Api.js#L256
> reject does not terminate the execution, it will still throw after the
> reject here...
>
> 4. "cordova clean -> Cleanup project from build artifacts". Are they
> "produced" by the build? Then you clean that up.
>
> On Tue, Jan 16, 2018 at 9:49 AM, Pat Deegan <pat.cordovadev@psychogenic.
> com>
> wrote:
>
> > Hi,
> >
> > First off, thanks for the answers.
> >
> > On 2018-01-15 08:25 PM, Shazron wrote:
> > > 1. Core platforms get the reserved names. Third-party platforms are
> named
> > > after what I presume is their repo name (not 100% sure on that last
> > part).
> >
> > Ok, cool--I can wait for a nice reserved name, down the road.
> >
> > >
> > > 2. I would check out a platform example, i.e. 'ios':
> > > Is this what you were looking for?
> >
> > Yes, perfect.  Will base mods on that.
> >
> > >
> > > 3. What do you mean by ugly? Example. AFAIK it's just "throw new
> > > CordovaError('error string')"
> >
> > Ok.  By ugly I mean instead of getting some:
> >
> >   "Error, cannot proceed: error string"
> >
> > or something similar, the output is instead:
> >
> > === snip ===
> >
> > (node:1025) UnhandledPromiseRejectionWarning: Error
> > [ERR_UNHANDLED_ERROR]: Unhandled error. (error string)
> >     at EventEmitter.emit (events.js:140:19)
> >     at EventEmitter.module.exports.emit
> > (/tmp/SomeApp/node_modules/cordova-common/src/events.js:71:17)
> >     at Object.module.exports.error
> > (/tmp/SomeApp/platforms/cordova-linux/cordova/logger.js:54:12)
> >     at Api.rejectAndThrow
> > (/tmp/SomeApp/platforms/cordova-linux/cordova/Api.js:258:9)
> >     at /tmp/SomeApp/platforms/cordova-linux/cordova/Api.js:280:8
> >     at new Promise (<anonymous>)
> >     at Api.build (/tmp/SomeApp/platforms/cordova-linux/cordova/Api.js:
> > 270:9)
> >     at
> > /usr/local/lib/node_modules/cordova/node_modules/cordova-
> > lib/src/cordova/compile.js:40:30
> >     at
> > /usr/local/lib/node_modules/cordova/node_modules/cordova-
> > lib/src/util/promise-util.js:30:24
> >     at _fulfilled
> > (/usr/local/lib/node_modules/cordova/node_modules/cordova-
> > lib/node_modules/q/q.js:787:54)
> > (node:1025) UnhandledPromiseRejectionWarning: Unhandled promise
> > rejection. This error originated either by throwing inside of an async
> > function without a catch block, or by rejecting a promise which was not
> > handled with .catch(). (rejection id: 2)
> > (node:1025) [DEP0018] DeprecationWarning: Unhandled promise rejections
> > are deprecated. In the future, promise rejections that are not handled
> > will terminate the Node.js process with a non-zero exit code.
> >
> >
> > === /snip ===
> >
> > Yeah, it contains the error string up there, at the top, but seems like
> > a pretty messy exit.
> >
> > I guess I kind of expect a catch somewhere above my call to make this
> > output more user friendly. Maybe it's an issue with my setup?
> >
> >
> > >
> > > 4. I couldn't find a question in there.
> >
> > Yeah, I sent the email somewhat incomplete there... the short of it was
> > "is it a faux pas to leave some built packages from previous versions
> > lying around after a 'clean'?".
> >
> > It's currently setup such that all the generated files/intermediate
> > results of a build are cleaned up on 'clean', but the versioned packages
> > created are left intact (unless you actually remove the platform).  I
> > like the "safety" of keeping older versions around, but will eliminate
> > them on 'clean' if it's the convention/expectation.
> >
> >
> > >
> > > TBH you would be the only person working on this, and there is no point
> > in
> > > putting this in the dead cordova-ubuntu repo. I would keep it in your
> > repo
> > > for now since that will be the fastest to iterate on since you won't
> have
> > > Apache committer privileges yet, and you will be blocked by us having
> to
> > > pull it in. Once it gets to a usable state, send a proposal to donate
> > your
> > > repo to Cordova in this dev@ list and we will proceed from there.
> >
> >
> > Sounds great, will do.
> >
> > Thanks,
> > P
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> > For additional commands, e-mail: dev-help@cordova.apache.org
> >
> >
>

Re: Linux Platform Integration Alpha (Api.js etc)

Posted by Shazron <sh...@gmail.com>.
3. Promises, ugh. Try reject OR throw, not both.
https://github.com/psychogenic/cordova-linux/blob/69a4dc92cae54e86761ad286c38710df8693b244/src/cordova/Api.js#L256
reject does not terminate the execution, it will still throw after the
reject here...

4. "cordova clean -> Cleanup project from build artifacts". Are they
"produced" by the build? Then you clean that up.

On Tue, Jan 16, 2018 at 9:49 AM, Pat Deegan <pa...@psychogenic.com>
wrote:

> Hi,
>
> First off, thanks for the answers.
>
> On 2018-01-15 08:25 PM, Shazron wrote:
> > 1. Core platforms get the reserved names. Third-party platforms are named
> > after what I presume is their repo name (not 100% sure on that last
> part).
>
> Ok, cool--I can wait for a nice reserved name, down the road.
>
> >
> > 2. I would check out a platform example, i.e. 'ios':
> > Is this what you were looking for?
>
> Yes, perfect.  Will base mods on that.
>
> >
> > 3. What do you mean by ugly? Example. AFAIK it's just "throw new
> > CordovaError('error string')"
>
> Ok.  By ugly I mean instead of getting some:
>
>   "Error, cannot proceed: error string"
>
> or something similar, the output is instead:
>
> === snip ===
>
> (node:1025) UnhandledPromiseRejectionWarning: Error
> [ERR_UNHANDLED_ERROR]: Unhandled error. (error string)
>     at EventEmitter.emit (events.js:140:19)
>     at EventEmitter.module.exports.emit
> (/tmp/SomeApp/node_modules/cordova-common/src/events.js:71:17)
>     at Object.module.exports.error
> (/tmp/SomeApp/platforms/cordova-linux/cordova/logger.js:54:12)
>     at Api.rejectAndThrow
> (/tmp/SomeApp/platforms/cordova-linux/cordova/Api.js:258:9)
>     at /tmp/SomeApp/platforms/cordova-linux/cordova/Api.js:280:8
>     at new Promise (<anonymous>)
>     at Api.build (/tmp/SomeApp/platforms/cordova-linux/cordova/Api.js:
> 270:9)
>     at
> /usr/local/lib/node_modules/cordova/node_modules/cordova-
> lib/src/cordova/compile.js:40:30
>     at
> /usr/local/lib/node_modules/cordova/node_modules/cordova-
> lib/src/util/promise-util.js:30:24
>     at _fulfilled
> (/usr/local/lib/node_modules/cordova/node_modules/cordova-
> lib/node_modules/q/q.js:787:54)
> (node:1025) UnhandledPromiseRejectionWarning: Unhandled promise
> rejection. This error originated either by throwing inside of an async
> function without a catch block, or by rejecting a promise which was not
> handled with .catch(). (rejection id: 2)
> (node:1025) [DEP0018] DeprecationWarning: Unhandled promise rejections
> are deprecated. In the future, promise rejections that are not handled
> will terminate the Node.js process with a non-zero exit code.
>
>
> === /snip ===
>
> Yeah, it contains the error string up there, at the top, but seems like
> a pretty messy exit.
>
> I guess I kind of expect a catch somewhere above my call to make this
> output more user friendly. Maybe it's an issue with my setup?
>
>
> >
> > 4. I couldn't find a question in there.
>
> Yeah, I sent the email somewhat incomplete there... the short of it was
> "is it a faux pas to leave some built packages from previous versions
> lying around after a 'clean'?".
>
> It's currently setup such that all the generated files/intermediate
> results of a build are cleaned up on 'clean', but the versioned packages
> created are left intact (unless you actually remove the platform).  I
> like the "safety" of keeping older versions around, but will eliminate
> them on 'clean' if it's the convention/expectation.
>
>
> >
> > TBH you would be the only person working on this, and there is no point
> in
> > putting this in the dead cordova-ubuntu repo. I would keep it in your
> repo
> > for now since that will be the fastest to iterate on since you won't have
> > Apache committer privileges yet, and you will be blocked by us having to
> > pull it in. Once it gets to a usable state, send a proposal to donate
> your
> > repo to Cordova in this dev@ list and we will proceed from there.
>
>
> Sounds great, will do.
>
> Thanks,
> P
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>
>

Re: Linux Platform Integration Alpha (Api.js etc)

Posted by Pat Deegan <pa...@psychogenic.com>.
Hi,

First off, thanks for the answers.

On 2018-01-15 08:25 PM, Shazron wrote:
> 1. Core platforms get the reserved names. Third-party platforms are named
> after what I presume is their repo name (not 100% sure on that last part).

Ok, cool--I can wait for a nice reserved name, down the road.

> 
> 2. I would check out a platform example, i.e. 'ios':
> Is this what you were looking for?

Yes, perfect.  Will base mods on that.

> 
> 3. What do you mean by ugly? Example. AFAIK it's just "throw new
> CordovaError('error string')"

Ok.  By ugly I mean instead of getting some:

  "Error, cannot proceed: error string"

or something similar, the output is instead:

=== snip ===

(node:1025) UnhandledPromiseRejectionWarning: Error
[ERR_UNHANDLED_ERROR]: Unhandled error. (error string)
    at EventEmitter.emit (events.js:140:19)
    at EventEmitter.module.exports.emit
(/tmp/SomeApp/node_modules/cordova-common/src/events.js:71:17)
    at Object.module.exports.error
(/tmp/SomeApp/platforms/cordova-linux/cordova/logger.js:54:12)
    at Api.rejectAndThrow
(/tmp/SomeApp/platforms/cordova-linux/cordova/Api.js:258:9)
    at /tmp/SomeApp/platforms/cordova-linux/cordova/Api.js:280:8
    at new Promise (<anonymous>)
    at Api.build (/tmp/SomeApp/platforms/cordova-linux/cordova/Api.js:270:9)
    at
/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/compile.js:40:30
    at
/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/util/promise-util.js:30:24
    at _fulfilled
(/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:787:54)
(node:1025) UnhandledPromiseRejectionWarning: Unhandled promise
rejection. This error originated either by throwing inside of an async
function without a catch block, or by rejecting a promise which was not
handled with .catch(). (rejection id: 2)
(node:1025) [DEP0018] DeprecationWarning: Unhandled promise rejections
are deprecated. In the future, promise rejections that are not handled
will terminate the Node.js process with a non-zero exit code.


=== /snip ===

Yeah, it contains the error string up there, at the top, but seems like
a pretty messy exit.

I guess I kind of expect a catch somewhere above my call to make this
output more user friendly. Maybe it's an issue with my setup?


> 
> 4. I couldn't find a question in there.

Yeah, I sent the email somewhat incomplete there... the short of it was
"is it a faux pas to leave some built packages from previous versions
lying around after a 'clean'?".

It's currently setup such that all the generated files/intermediate
results of a build are cleaned up on 'clean', but the versioned packages
created are left intact (unless you actually remove the platform).  I
like the "safety" of keeping older versions around, but will eliminate
them on 'clean' if it's the convention/expectation.


> 
> TBH you would be the only person working on this, and there is no point in
> putting this in the dead cordova-ubuntu repo. I would keep it in your repo
> for now since that will be the fastest to iterate on since you won't have
> Apache committer privileges yet, and you will be blocked by us having to
> pull it in. Once it gets to a usable state, send a proposal to donate your
> repo to Cordova in this dev@ list and we will proceed from there.


Sounds great, will do.

Thanks,
P


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: Linux Platform Integration Alpha (Api.js etc)

Posted by Shazron <sh...@gmail.com>.
1. Core platforms get the reserved names. Third-party platforms are named
after what I presume is their repo name (not 100% sure on that last part).

2. I would check out a platform example, i.e. 'ios':
    -
https://github.com/apache/cordova-ios/blob/8edd13aaee16d6996a4560a74d17798437b42c6f/bin/templates/scripts/cordova/Api.js#L464
    -
https://github.com/apache/cordova-ios/blob/8edd13aaee16d6996a4560a74d17798437b42c6f/bin/templates/scripts/cordova/lib/check_reqs.js#L185

Is this what you were looking for?

3. What do you mean by ugly? Example. AFAIK it's just "throw new
CordovaError('error string')"

4. I couldn't find a question in there.

TBH you would be the only person working on this, and there is no point in
putting this in the dead cordova-ubuntu repo. I would keep it in your repo
for now since that will be the fastest to iterate on since you won't have
Apache committer privileges yet, and you will be blocked by us having to
pull it in. Once it gets to a usable state, send a proposal to donate your
repo to Cordova in this dev@ list and we will proceed from there.


On Mon, Jan 15, 2018 at 6:36 AM, Pat Deegan <pa...@psychogenic.com>
wrote:

> Hi all,
>
> Anyone have input on my Qs from the 5th?
>
> I'm especially interested in the second question, related to setting up
> Api.prototype.requirements, and in anything else I'd need to do to
> polish things up before making a pull request.
>
> Also, which repo would this request be made on?
>
> Thanks!
> PatD
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>
>

Re: Linux Platform Integration Alpha (Api.js etc)

Posted by Pat Deegan <pa...@psychogenic.com>.
Hi all,

Anyone have input on my Qs from the 5th?

I'm especially interested in the second question, related to setting up
Api.prototype.requirements, and in anything else I'd need to do to
polish things up before making a pull request.

Also, which repo would this request be made on?

Thanks!
PatD


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org