Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add B2G build and new preprocessor. #1953

Merged
merged 8 commits into from
Aug 8, 2012
Merged

Conversation

brendandahl
Copy link
Contributor

Since we're adding another target that I believe will require more customization in the future and I think our strategy of just using SED was getting too messy, I've added a new preprocessor which tries to follow the ff preprocessor(https://developer.mozilla.org/en/Build/Text_Preprocessor). I also added another little build helper function to help with common steps we were taking in the main build targets(firefox,chrome,mozcentral,b2g,web). We could probably simplify things even further if we added an initial layout step to this, but the PR was already getting too big so I'll wait to do that.

Also, I added a new build target generic which builds the generic production version of pdf.js. This is basically the contents of our old web build target. I mainly did this because now the file build/pdf.js is not preprocessed since it needs to be preprocessed differently by each main build target.

For testing, I built all the targets and compared them to the current build output. Everything still needs verification though.

@brendandahl
Copy link
Contributor Author

/botio-windows preview
/botio-linux lint

@pdfjsbot
Copy link

pdfjsbot commented Aug 1, 2012

From: Bot.io (Linux)


Received

Command cmd_lint from @brendandahl received. Current queue size: 0

Live output at: http://107.21.233.14:8877/c531b9fe175854a/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Aug 1, 2012

From: Bot.io (Windows)


Received

Command cmd_preview from @brendandahl received. Current queue size: 0

Live output at: http://107.22.172.223:8877/42440e5b0162f67/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Aug 1, 2012

@pdfjsbot
Copy link

pdfjsbot commented Aug 1, 2012

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/c531b9fe175854a/output.txt

Total script time: 1.28 mins

  • Lint: Passed

@arturadib
Copy link
Contributor

As per IRC, @brendandahl will factor out BuildHelper and require() it

@@ -150,6 +151,7 @@ var FirefoxCom = (function FirefoxComClosure() {
}
};
})();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we comment it or include as a snippet?

@yurydelendik
Copy link
Contributor

Build/pdf.js and build/chrome/content/build/pdf.js still have pre-processor directives.

Not really sure how to check B2G output. node make b2g outputs:

### Building B2G (Firefox OS App)

### Bundling files into build/pdf.js

timers.js:103
            if (!process.listeners('uncaughtException').length) throw e;
                                                                      ^
Error: ENOENT, no such file or directory 'c:\Work\pdf.js\web\viewer-snippet-b2g.
html'
    at Object.fs.openSync (fs.js:338:18)
    at Object.fs.readFileSync (fs.js:182:15)
    at preprocess (c:\Work\pdf.js\external\builder\builder.js:20:18)
    at include (c:\Work\pdf.js\external\builder\builder.js:36:5)
    at preprocess (c:\Work\pdf.js\external\builder\builder.js:79:13)
    at c:\Work\pdf.js\external\builder\builder.js:124:7
    at Array.forEach (native)
    at c:\Work\pdf.js\external\builder\builder.js:119:13
    at Array.forEach (native)
    at Object.build (c:\Work\pdf.js\external\builder\builder.js:114:20)

+1 from me if notes above will be addressed

@brendandahl
Copy link
Contributor Author

Missed adding the snippet file. For playing with b2g I've been using the desktop builds from:
http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central/

And running the following script:

#!/bin/sh
pushd .;
cd ~/projects/mine/pdf.js
node make b2g
#cp ~/projects/mine/pdf.js/web/compressed.tracemonkey-pldi-09.pdf ~/projects/mine/pdf.js/build/b2g/content/web/;
cp -R ~/projects/mine/pdf.js/build/b2g/content ~/projects/mine/gaia/apps/pdfjs/;
cd ~/projects/mine/gaia
rm -rf profile
make
/Applications/B2G.app/Contents/MacOS/b2g -jsconsole -profile ~/projects/mine/gaia/profile/
popd;

@yurydelendik
Copy link
Contributor

For empty repo, node make b2g generates:

### Building B2G (Firefox OS App)

### Bundling files into build/pdf.js
cp: no such file or directory: web/locale.properties

Other than that works; tested with gaia commit 5e3499c4ad1d

yurydelendik added a commit that referenced this pull request Aug 8, 2012
Add B2G build and new preprocessor.
@yurydelendik yurydelendik merged commit 70beb11 into mozilla:master Aug 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants