Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Externalize the paths #8

Closed
yaronyg opened this issue Jul 15, 2016 · 4 comments
Closed

Externalize the paths #8

yaronyg opened this issue Jul 15, 2016 · 4 comments
Assignees
Labels
Milestone

Comments

@yaronyg
Copy link
Member

yaronyg commented Jul 15, 2016

Right now we hardcode in paths pointing to our distribution points during the build. That would be what is known as 'bad'. :) We need to submit a PR to JXcore that lets us set the paths in some kind of external configuration file so that different people who download JXcore can choose to point at whatever location they want. I found at least three files in JXcore forexample that point directly at azureedge.net. But that is an endpoint owned by Microsoft. It's not something that should be in the general JXcore repo. Instead those values should point at configuration files that someone building JXcore can set up and then do a compile and produce an output that points where ever they want.

By externalizing this we can keep the JXcore build agonist from Microsoft which is what we want. We are absolutely NOT promising the world to host JXcore! :)

@enricogior
Copy link
Member

First hardcoded path I run into while working on thaliproject/Thali_CordovaPlugin#763 is in this script:
https://github.com/jxcore/jxcore/blob/master/tools/npmjx/index.js at line 199 contains:

https://jxcore.azureedge.net/npmjx/npmjx311.tar.gz

while https://github.com/jxcore/jxcore/blob/master/tools/npmjx/index.js contains:

https://s3.amazonaws.com/nodejx/npmjx311.tar.gz

(btw, that returns an AccessDenied error).
The url will be externalized in a config file and/or a command switch.

@enricogior
Copy link
Member

There is also https://github.com/thaliproject/jxcore/blob/master/lib/jx/_jx_install.js that contains hardcoded strings:

128.   var npm_basename = 'npmjxv311.jx';
129.   var npm_str = 'https://jxcore.azureedge.net/npmjx/' + npm_basename;

_jx_install.js in turn calls npmjx/index.js.

@enricogior
Copy link
Member

The solution consists of:

  • source files that contain hard-coded URLs are replaced by templates containing URL_IDs.
  • one global configuration file to store the URL_IDs and theirs values.
  • script(s) invoked during the build process to create the source files from the templates.

enricogior added a commit that referenced this issue Aug 2, 2016
Jxcore uses its own npm version and the urls to the modules were hardcoded.
Issue #8
enricogior added a commit that referenced this issue Aug 2, 2016
Jxcore uses its own npm version and the urls to the modules were hardcoded.
Issue #8
enricogior added a commit that referenced this issue Aug 2, 2016
Jxcore uses its own npm version and the urls to the modules were hardcoded.
Issue #8
enricogior added a commit that referenced this issue Aug 2, 2016
Jxcore uses its own npm version and the urls to the modules were hardcoded.
Issue #8
enricogior added a commit that referenced this issue Aug 2, 2016
Jxcore uses its own npm version and the urls to the modules were hardcoded.
Issue #8
@enricogior
Copy link
Member

PR submitted.
#17

@yaronyg yaronyg added this to the V1 milestone Aug 3, 2016
enricogior added a commit that referenced this issue Aug 4, 2016
enricogior added a commit that referenced this issue Aug 8, 2016
A previous change to the Makefile for Issue #8 is not working when
building Android on macOS.
enricogior added a commit that referenced this issue Aug 8, 2016
A previous change to the Makefile for Issue #8 is not working when
building Android on macOS.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants