Преглед изворни кода

Ensure generated parser is re-generated during build (#12937)

Ultimately we should remove Parser.java and other generated files from
the project but this still needs tweaking ide.xml somehow so the parser
is built.

Change-Id: Iac491c6a50c87e1e8e0bb2f612e82186319a6de3
tags/7.1.9
Artur Signell пре 10 година
родитељ
комит
3680505544
2 измењених фајлова са 40 додато и 3 уклоњено
  1. 15
    0
      theme-compiler/apache2header.txt
  2. 25
    3
      theme-compiler/build.xml

+ 15
- 0
theme-compiler/apache2header.txt Прегледај датотеку

@@ -0,0 +1,15 @@
/*
* Copyright 2000-2013 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

+ 25
- 3
theme-compiler/build.xml Прегледај датотеку

@@ -1,6 +1,6 @@
<?xml version="1.0"?>

<project name="vaadin-theme-compiler" basedir="." default="publish-local" xmlns:ivy="antlib:org.apache.ivy.ant">
<project name="vaadin-theme-compiler" basedir="." default="publish-local" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:antcontrib="antlib:net.sf.antcontrib">
<description>
Compiles build helpers used when building other modules.
</description>
@@ -12,7 +12,10 @@
<property name="module.name" value="vaadin-theme-compiler" />
<property name="module.symbolic" value="com.vaadin.theme-compiler" />
<property name="result.dir" value="result" />
<property name="sass.parser.jj" location="src/com/vaadin/sass/internal/parser/Parser.jj" />
<property name="parser.src.dir" value="src/com/vaadin/sass/internal/parser" />
<property name="generate.dir" value="${result.dir}/generated/${parser.src.dir}" />
<property name="header.file" location="apache2header.txt" />

<path id="classpath.compile.custom">
</path>
<path id="classpath.test.custom" />
@@ -25,8 +28,27 @@
javacc task requires the jar to be named javacc.jar -->
<property name="javacc.home" location="${result.dir}/javacc" />
<ivy:retrieve organisation="net.java.dev.javacc" module="javacc" revision="5.0" inline="true" type="jar" pattern="${javacc.home}/[artifact].[ext]" />
<javacc target="${sass.parser.jj}" javacchome="${javacc.home}">
<delete dir="${generate.dir}" />
<mkdir dir="${generate.dir}" />
<!-- Generate new parser files in another directory, this ensure
they are always generated -->
<copy file="${parser.src.dir}/Parser.jj" todir="${generate.dir}" />
<javacc target="${generate.dir}/Parser.jj" javacchome="${javacc.home}">
</javacc>
<!-- Add headers to the generated files and copy back to src -->
<antcontrib:foreach target="prepend.generated.file.header" param="path">
<path>
<fileset dir="${generate.dir}" includes="*.java" />
</path>
</antcontrib:foreach>
</target>

<target name="prepend.generated.file.header">
<basename property="file" file="${path}" />
<concat destfile="${parser.src.dir}/${file}">
<header filtering="no" trimleading="no" file="${header.file}" />
<path path="${generate.dir}/${file}" />
</concat>
</target>

<target name="jar" depends="parser">

Loading…
Откажи
Сачувај