0

I used Initializr to set up a new HTML5 project.
I am trying to use Ant Build Script to optimize the files for production : minization , and all that stuff.

I followed every instructions in the ReadMe, basically :

  • Install JAVA JDK and WinAnt
  • Go to project root /build and execute ant build

I have this error :

Buildfile: build.xml does not exist!
Build failed

Is this a file I'am supposed to write myself ? If so then I think it's weird the readme doesn't mention it at all.

Edit : Sorry I made a mistake in the path, I already was in the /build subfolder as specified in the readme.

Edit2 : Also I realize now that I skipped the "Add the build script to your project" part. When I execute "git checkout -b ant-build-script" I have the error :

fatal: Not a git repository (or any of the parent directories): .git

So I guess I need to set a git repo in my project first. Is there a way to retrieve the right files without using git ?

Edit3 : I set up a git repo and followed the instructions, but now I have errors during the build process. The problem seems to be concat.js. The errors seem to indicate missing files, for instance :

[concat] C:\wamp\www\MoviesLouis\intermediate\index.html does not exist.

The intermediate folder is made by Ant build script, I have no control on it. The build still finishes with "BUILD SUCCESSFUL".

The result is in the /publish folder, and I can see that all my javascript files are missing (except the ones in the /js/vendor folder).

Should I make a new question ?

1
  • 1
    Go to the Build subdir and execute ant there. Commented Mar 24, 2013 at 7:29

3 Answers 3

1

You can change the file.root.page property, in your project.properties to point to whatever file you want

Sign up to request clarification or add additional context in comments.

1 Comment

Almost working, but the generated index.php still references the unconcatenated javascript files instead of the new concatenated one. I should probably report this issue.
0

As you can see in the file build.xml here: https://github.com/h5bp/ant-build-script/blob/master/build.xml in line 3 basedir is ../, and then it explains why: "one back since we're in build" it means that you have to execute from the build sub folder, not from the project's root. Also, in runscript.bat https://github.com/h5bp/ant-build-script/blob/master/runbuildscript.bat it says: "If you're on a mac or linux, just run ant build from this folder in Terminal", where "this folder" is again the build subfolder.

Comments

0

The build script wasn't working because I renamed index.html to index.php. For now I will rename it back to html every time I want to build, but I'm still looking for an automated solution.

1 Comment

You could try changing the project.properties or default.properties file in the build/config directory. See file.root.page directive. Set it to index.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.