Code Monkey home page Code Monkey logo

Comments (6)

siad007 avatar siad007 commented on June 21, 2024

Hi @jawira did you try with fixLastLine Attribute set to true?

from phing.

jawira avatar jawira commented on June 21, 2024

Hi @siad007 ! Thanks for replying :) I just tried to use fixLastLine but my build keeps failing:

BUILD FAILED
/home/jawira/PhpstormProjects/xxxxxx/build.xml:236:59 You must specify a file, use a filelist/fileset, or specify a text value.

Total time: 0.0444 seconds

I'm more curious about why sanitizeText is required? what if I just want to append white spaces?

I can make a PR if required. Since this is not very important, you can also close this issue if you want :)

from phing.

siad007 avatar siad007 commented on June 21, 2024

Hi @jawira - sry for that long delay.

Looking here a little bit closer, we have a bug here.

I'm more curious about why sanitizeText is required?

AFAIK This is needed against empty text arguments like <append destFile="my-file.txt" text=""/> (related also to xml parsing)

Things that should work are at least:

<?xml version="1.0" encoding="UTF-8" ?>
<project name="test" default="one">
    <target name="one">
        <append destFile="my-file.txt" text="${line.separator}"/>
    </target>
    <target name="two">
        <append destFile="my-file.txt" text="
"/>
    </target>
    <target name="three">
        <append destFile="my-file.txt" text="&#10;"/>
    </target>
</project>

from phing.

mrook avatar mrook commented on June 21, 2024

Actually, this is by design and matches the way the Concat task works in Ant. This is because adding a nested text element may introduce additional (ignorable) whitespace. Hence the sanitizeText call at the start of validate. This is not well documented, and maybe we need to introduce a switch that can disable that behavior.

from phing.

mrook avatar mrook commented on June 21, 2024

phingofficial/guide@bad7358

from phing.

jawira avatar jawira commented on June 21, 2024

@mrook thanks

from phing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.