Liferay 6.2 Ant Build - обновить компилятор SCSS - PullRequest
0 голосов
/ 15 апреля 2019

В настоящее время я занимаюсь разработкой темы liferay, но при компиляции одного из файлов SCSS я получаю следующую ошибку:

 [java] Sass::SyntaxError: Invalid CSS after "  @each $key": expected "in", was ", $num in $map {"
 [java]            expected at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/scss/parser.rb:1147
 [java]            expected at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/scss/parser.rb:1084
 [java]                tok! at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/scss/parser.rb:1079
 [java]      each_directive at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/scss/parser.rb:248
 [java]                send at org/jruby/RubyKernel.java:2093
 [java]   special_directive at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/scss/parser.rb:174
 [java]           directive at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/scss/parser.rb:146
 [java]         block_child at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/scss/parser.rb:553
 [java]      block_contents at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/scss/parser.rb:545
 [java]               block at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/scss/parser.rb:534
 [java]     mixin_directive at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/scss/parser.rb:186
 [java]                send at org/jruby/RubyKernel.java:2093
 [java]   special_directive at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/scss/parser.rb:174
 [java]           directive at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/scss/parser.rb:146
 [java]         block_child at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/scss/parser.rb:552
 [java]      block_contents at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/scss/parser.rb:542
 [java]          stylesheet at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/scss/parser.rb:82
 [java]               parse at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/scss/parser.rb:27
 [java]            _to_tree at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/engine.rb:342
 [java]             to_tree at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/engine.rb:272
 [java]        visit_import at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/perform.rb:225
 [java]                send at org/jruby/RubyKernel.java:2097
 [java]               visit at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/base.rb:37
 [java]               visit at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/perform.rb:100
 [java]        visit_import at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/perform.rb:227
 [java]             collect at org/jruby/RubyArray.java:2318
 [java]        visit_import at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/perform.rb:227
 [java]                send at org/jruby/RubyKernel.java:2097
 [java]               visit at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/base.rb:37
 [java]               visit at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/perform.rb:100
 [java]      visit_children at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/base.rb:53
 [java]             collect at org/jruby/RubyArray.java:2318
 [java]      visit_children at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/base.rb:53
 [java]      visit_children at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/perform.rb:109
 [java]    with_environment at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/perform.rb:121
 [java]      visit_children at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/perform.rb:108
 [java]               visit at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/base.rb:37
 [java]          visit_rule at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/perform.rb:320
 [java]                send at org/jruby/RubyKernel.java:2097
 [java]               visit at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/base.rb:37
 [java]               visit at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/perform.rb:100
 [java]      visit_children at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/base.rb:53
 [java]             collect at org/jruby/RubyArray.java:2318
 [java]      visit_children at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/base.rb:53
 [java]      visit_children at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/perform.rb:109
 [java]    with_environment at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/perform.rb:121
 [java]      visit_children at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/perform.rb:108
 [java]               visit at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/base.rb:37
 [java]          visit_root at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/perform.rb:128
 [java]                send at org/jruby/RubyKernel.java:2097
 [java]               visit at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/base.rb:37
 [java]               visit at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/perform.rb:100
 [java]                send at org/jruby/RubyKernel.java:2097
 [java]               visit at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/visitors/perform.rb:7
 [java]              render at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/tree/root_node.rb:20
 [java]             _render at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/engine.rb:315
 [java]              render at C:/Users/BARRYC~1/AppData/Local/Temp/liferay/ruby/gems/sass-3.2.12/lib/sass/../sass/engine.rb:262
 [java]              (root) at <script>:48
 [java] Exception in thread "main" org.jruby.embed.EvalFailedException: (SyntaxError) Invalid CSS after "  @each $key": expected "in", was ", $num in $map {"
 [java]     at org.jruby.embed.internal.EmbedEvalUnitImpl.run(EmbedEvalUnitImpl.java:127)
 [java]     at org.jruby.embed.ScriptingContainer.runUnit(ScriptingContainer.java:1231)
 [java]     at org.jruby.embed.ScriptingContainer.runScriptlet(ScriptingContainer.java:1224)
 [java]     at com.liferay.portal.scripting.ruby.RubyExecutor.doEval(RubyExecutor.java:189)
 [java]     at com.liferay.portal.scripting.ruby.RubyExecutor.eval(RubyExecutor.java:229)
 [java]     at com.liferay.portal.scripting.ruby.RubyExecutor.eval(RubyExecutor.java:129)
 [java]     at com.liferay.portal.tools.SassToCssBuilder._parseSassFile(SassToCssBuilder.java:288)
 [java]     at com.liferay.portal.tools.SassToCssBuilder._parseSassDirectory(SassToCssBuilder.java:247)
 [java]     at com.liferay.portal.tools.SassToCssBuilder.<init>(SassToCssBuilder.java:139)
 [java]     at com.liferay.portal.tools.SassToCssBuilder.main(SassToCssBuilder.java:93)
 [java] Caused by: org.jruby.exceptions.RaiseException: (SyntaxError) Invalid CSS after "  @each $key": expected "in", was ", $num in $map {"
 [java] Unable to parse /css/aui.css
 [java] Java Result: 1

Файл-нарушитель (aui.css):

$FontAwesomePath: "aui/font-awesome-5/font" !default;

//@import "aui/alloy-font-awesome/scss/variables";
//@import "aui/alloy-font-awesome/scss/mixins-alloy";
//@import "aui/alloy-font-awesome/scss/path-alloy";

.aui {
    @import "aui_variables";

    $iconSpritePath: '../images/aui/glyphicons-halflings.png' !default;
    $iconWhiteSpritePath: '../images/aui/glyphicons-halflings-white.png' !default;

    //@import "aui/bootstrap"; // Remove >> Bootstrap 2.3.2
    @import "aui/variables-alloy";
    @import "aui/variables";
    @import "aui/bs4/bootstrap"; // Add >> Bootstrap 3.5
}

Я использую Liferay 6.2 EE GA1, и эту ошибку из того, что я прочитал, возможно, можно исправить, обновив компилятор SCSS (ruby gem).Тем не менее, я не знаю, как к этому подойти.Он использует ant builder (build.xml).

Если бы я мог либо исправить вышеуказанную ошибку, либо обновить компилятор (или оба?), Это было бы здорово!

Ответы [ 2 ]

1 голос
/ 16 апреля 2019

Мне удалось обновить Liferay 6.2 до начальной загрузки 4:

  1. Вам нужно перейти на tomcat / webapps / ROOT / WEB-INF / lib и удалить ruby-gems.jar

  2. Скачать com.liferay.ruby.gems-1.0.1.jar (поиск в Интернете) и поместить его в библиотекупапка выше

  3. Измените свои portal-ext.properties и добавьте это:

#jruby fix
scripting.jruby.load.paths=\
classpath:/META-INF/jruby.home/lib/ruby/site_ruby/1.8,\
classpath:/META-INF/jruby.home/lib/ruby/site_ruby/shared,\
classpath:/gems/chunky_png-1.3.5/lib,\
classpath:/gems/compass-1.0.1/lib,\
classpath:/gems/compass-core-1.0.3/lib,\
classpath:/gems/multi_json-1.11.3/lib,\
classpath:/gems/fssm-0.2.9/lib,\
classpath:/gems/sass-3.4.22/lib,\
${java.io.tmpdir}/liferay/ruby/gems/chunky_png-1.3.5/lib,\
${java.io.tmpdir}/liferay/ruby/gems/compass-1.0.1/lib,\
${java.io.tmpdir}/liferay/ruby/gems/fssm-0.2.9/lib,\
${java.io.tmpdir}/liferay/ruby/gems/sass-3.4.22/lib
Очистите работу tomcat и временный каталог, а затем перезапустите Liferay

Также я немного изменил свою тему ... изменил все файлы aui.css, main.css (и импорт) на файлы scss(потому что они на самом деле не CSS) и использовали webpack 4 для их компиляции (это намного быстрее, чем Ruby).

1 голос
/ 15 апреля 2019

Если вы хотите обновить версию SASS вручную, вы можете переустановить свойство scripting.jruby.load.paths.Пожалуйста, взгляните на 6.2 Свойства портала .Таким образом, вы не используете classpath или java.io.tmpdir, а вместо этого другую папку.Тем не менее, я не проверял это, и, возможно, что-то еще не получится с этим обновлением (также вам нужна концепция сборки CI).

...