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

Modified apps folder search to look for apps instead of brjs-apps. #1417

Merged
merged 26 commits into from
Jun 17, 2015

Conversation

ioanalianabalas
Copy link
Contributor

Fixes issue #1408.

I have changed the expected apps directory to apps, which must be located next to the sdk. Otherwise, the current working directory will be the apps location. I have also modified all our tests accordingly.

@thanhc
Copy link
Contributor

thanhc commented Jun 10, 2015

got two small issues with this ticket:

  1. it seems like instead of checking for app.conf to see if something is an app or not, we also assume a folder is an app if there is a .html file in it.
  2. From /brjs-sdk/sdk if I delete the apps/ folder from brjs-sdk/ and then run ./brjs serve, ideally what should happen is that it checks if there is an apps folder next to the SDK and if not then create one and use it, but instead it seems to check if there is an apps folder and because there isn't it then assumes the SDK folder is the apps folder and prints out all the warning messages saying brjs-sdk/sdk/docs is not an app .... before then creating an apps folder and using it. Also when I do this I get a SAXParseException:

FATAL@null line:-1 col:-1 : org.xml.sax.SAXParseException; Premature end of file.
Failed startup of context o.e.j.w.WebAppContext{/j2eeify-app,file:/D:/Development/brjs/brjs-sdk/sdk/j2eeify-app/}
org.xml.sax.SAXParseException; Premature end of file.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

@andy-berry-dev
Copy link
Member

it seems like instead of checking for app.conf to see if something is an app or not, we also assume a folder is an app if there is a .html file in it.

Since the app checking code was written we've done this. You're right though we should probably only consider something an app if app.conf is present. I think there were problems doing that though, I remember some tests failing when there was a stricter check. It would be worth making it stricter and seeing what fails.

From /brjs-sdk/sdk if I delete the apps/ folder from brjs-sdk/ and then run ./brjs serve, ideally what should happen is that it checks if there is an apps folder next to the SDK and if not then create one and use it, but instead it seems to check if there is an apps folder and because there isn't it then assumes the SDK folder is the apps folder

IMO this is the correct behaviour and the creation of the apps dir should be the responsibility of another part of the code. Whenever a BRJS is created it is populated using the templates, this is what creates the apps dir. It would be wrong for the app dir detection code to also be creating directories. This is something we should write a test for though.

@ioanalianabalas
Copy link
Contributor Author

Fixed issues and merged the develop branch in.

@thanhc thanhc added the 2 - Dev label Jun 16, 2015
@andy-berry-dev
Copy link
Member

I've also added to this PR a change so the discovered app log is only printed the first time apps are used since it looked like this was causing problems with some observer plugins.

@andy-berry-dev
Copy link
Member

I've also fixed the bug where the apps directory was created inside of sdk if run via the ./brjs command. @thanhc this is ready to be QA'd and merged now.

thanhc added a commit that referenced this pull request Jun 17, 2015
…apps-1408

Modified apps folder search to look for apps instead of brjs-apps.
@thanhc thanhc merged commit b00f5a9 into develop Jun 17, 2015
@thanhc thanhc deleted the use-apps-folder-for-brjs-apps-1408 branch June 17, 2015 16:19
@thanhc thanhc added 6 - Done and removed 5 - Test labels Jun 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants