0

こんにちは、Ant BuildScript の設定に問題があります。ant を実行すると、Java スクリプトと CSS が圧縮されず、スタイルシート リンクが乱数に更新されません。

project.properties ファイルでは、次のものを使用しています。

file.root.stylesheet    = screen.css
dir.js              = includes/js
dir.js.main         = ${dir.js}
#build.css.scss         = true
dir.css             = css

コンパスによって既にコンパイルされているため、ビルド sass はオフになってい
ます。

<!-- //-beg- concat_js -->
<script src="includes/js/script1.js"></script>
<script src="includes/js/script2.js"></script>
<!-- //-end- concat_js -->

私が使用しているフォルダー構造は次のとおりです。

  • css/
  • 画像/
  • インクルード/サス
    • foundation.scc、screen.scss
  • インクルード/js
  • include/file.php

次のエラーが表示されます

-js.all.minify:
     [echo] Minifying scripts
     [copy] Copying 4 files to c:\projectfolder\intermediate\includes\js
    [apply] c:\projectfolder\includes\js\plugins.js:86: ERROR - Parse error. IE8 (and below) will parse trailing commas in array and object literals incorrectly. If you are targeting newer
versions of JS, set the appropriate language_in option.
    [apply]                     firstName :  "required",
    [apply]                     ^
    [apply]
    [apply] 1 error(s), 0 warning(s)
    [apply] Result: 1

-js.main.concat:
     [echo] Concatenating Main JS scripts based on index.html...
     [exec] Result: 1
   [concat] c:\projectfolder\intermediate\Exception does not exist.
   [concat] c:\projectfolder\intermediate\in does not exist.
   [concat] c:\projectfolder\intermediate\thread does not exist.
   [concat] c:\projectfolder\intermediate\"main" does not exist.
   [concat] c:\projectfolder\intermediate\java.io.FileNotFoundException: does not exist.
   [concat] c:\projectfolder\intermediate\index.html does not exist.
   [concat] c:\projectfolder\intermediate\(Het does not exist.
   [concat] c:\projectfolder\intermediate\systeem does not exist.
   [concat] c:\projectfolder\intermediate\kan does not exist.
   [concat] c:\projectfolder\intermediate\het does not exist.
   [concat] c:\projectfolder\intermediate\opgegeven does not exist.
   [concat] c:\projectfolder\intermediate\bestand does not exist.
   [concat] c:\projectfolder\intermediate\niet does not exist.
   [concat] c:\projectfolder\intermediate\vinden) does not exist.
   [concat] c:\projectfolder\intermediate\at does not exist.
   [concat] c:\projectfolder\intermediate\java.io.FileInputStream.open(Native does not exist.
   [concat] c:\projectfolder\intermediate\Method) does not exist.
   [concat] c:\projectfolder\intermediate\at does not exist.
   [concat] c:\projectfolder\intermediate\java.io.FileInputStream.<init>(FileInputStream.java:138) does not exist.
   [concat] c:\projectfolder\intermediate\at does not exist.
   [concat] c:\projectfolder\intermediate\java.io.FileInputStream.<init>(FileInputStream.java:97) does not exist.
   [concat] c:\projectfolder\intermediate\at does not exist.
   [concat] c:\projectfolder\intermediate\java.io.FileReader.<init>(FileReader.java:58) does not exist.
   [concat] c:\projectfolder\intermediate\at does not exist.
   [concat] c:\projectfolder\intermediate\FindAttribute.main(Unknown does not exist.
   [concat] c:\projectfolder\intermediate\Source) does not exist.

jsfiddle アカウント http://jsfiddle.net/piggybattery/bpxBM/1/に完全なエラー ログを配置しました。

この構造にチェーンする方法を知っている人はいますか?

4

1 に答える 1

0

縮小エラーの原因となっている末尾のコンマを修正します。それは良い考えです。

それ以外にも、うまくいかない可能性のあるものが約 100 万件あるようです。ビルド スクリプトは、HTML ボイラープレート構造で非常に使いやすいように作成されています。PHP、SASS、Foundation などを追加し始めると、うまくいかないことがどんどん増えていきます。それはそれらのもので動作することができます.あなたが行った変更を認識し、それらをビルドスクリプトに反映する必要があるだけです.

最も重要なことは、プロパティ ファイル内のパスは、Ant と Java が検出できる実際のファイルを指している必要があるということです。

したがって、プロジェクトのルート (ビルド ディレクトリの 1 つ上) から、dir.*およびfile.*プロパティを使用して作成する文字列が、ディスク上およびソース コード内に存在するものを指していることを確認してください。したがって、たとえば、スクリプトがあなたを見つけられない場合file.root.page(index.htmlデフォルトで検索します。プロジェクトに index.html がないと思いますか?)、コメント内のスクリプトを連結することはできません。さらに、問題が発生することが見つからない場合file.root.stylesheet(メインの CSS ファイルは にありますかcss/screen.css? HTML で参照されていますか? ここでソースを交換します)。file.root.scriptfile.root.scriptscript1.jsscript2.js? 繰り返しますが、これはソースを変更するのに役立ちます) 基本的に、デフォルトの HTML5 Boilderplate 構造から変更を加えるたびに、それらのプロパティに反映する必要があります。

于 2013-10-23T12:53:06.343 に答える