Working with branches related to issue - Simplyfying work Part II

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Working with branches related to issue - Simplyfying work Part II

Karl Heinz Marbaise-3
Hi,

I have finished my write up about my current working scripts to make my
life easier...

If someone is interested in take a look at:

https://blog.soebes.de/blog/2018/07/30/automate-it-part-ii/

suggestions/ideas are always welcome...

Kind regards
Karl Heinz Marbaise

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Working with branches related to issue - Simplyfying work Part II

Enrico Olivelli
awesome reading!

Thank you for sharing your experience

Enrico

(Nit: There is a little typo 'appriopriate')

Il lun 30 lug 2018, 20:21 Karl Heinz Marbaise <[hidden email]> ha
scritto:

> Hi,
>
> I have finished my write up about my current working scripts to make my
> life easier...
>
> If someone is interested in take a look at:
>
> https://blog.soebes.de/blog/2018/07/30/autiomate-it-part-ii/
> <https://blog.soebes.de/blog/2018/07/30/automate-it-part-ii/>
>
> suggestions/ideas are always welcome...
>
> Kind regards
> Karl Heinz Marbaise
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
> --


-- Enrico Olivelli
Reply | Threaded
Open this post in threaded view
|

Re: Working with branches related to issue - Simplyfying work Part II

Jörg Schaible-5
In reply to this post by Karl Heinz Marbaise-3
Hi Karl-Heinz,

Am Mon, 30 Jul 2018 20:21:13 +0200 schrieb Karl Heinz Marbaise:

> Hi,
>
> I have finished my write up about my current working scripts to make my
> life easier...
>
> If someone is interested in take a look at:
>
> https://blog.soebes.de/blog/2018/07/30/automate-it-part-ii/
>
> suggestions/ideas are always welcome...

An invaluable source of processing XML files is the xmlstarlet package
(typically installed as /usr/bin/xml), e.g. for extracting the URL for
the issues.

Example: I have a short bash script to generate recursively minimal
Eclipse project files for packaging types that are ignored by the maven-
eclipse-plugin:

========== %< ============
#!/bin/sh

packaging=pom
if [ "$1" = "-p" ]; then
    shift
    packaging=$1
    shift
fi

if [ $# -lt 1 ]; then
    echo "Usage ${0##*/} [-p packaging] dir ..."
else
    idx=0
    poms=( "$@" )
    while [ $idx -lt ${#poms[@]} ]; do
        pom=${poms[$idx]}/pom.xml
        path=${pom%/*}
        let idx=$idx+1
        if [ -f "$pom" ]; then
            modules=`xml sel -N pom=$XMLNS_POM -t -m pom:project -m
pom:modules -v pom:module $pom`
            if [ -n "$modules" ]; then
                for module in ${modules[*]}; do
                    poms+=( $path/$module )
                done
            else
                if [ "$packaging" = "`xml sel -N \"pom=$XMLNS_POM" -t -m
pom:project -v pom:packaging \"$pom\"`" ]; then
                    if [ ! -f "$path"/.project ]; then
                        name=`xml sel -N "pom=$XMLNS_POM" -t -m
pom:project -v pom:artifactId "$pom"`
                        echo '<projectDescription><name>'"$name"'</name></
projectDescription>' > "$path"/.project && echo "$path/.project"
                    fi
                fi
            fi
        fi
    done
fi
========== %< ============

The variable XMLNS_POM is declared in my .bashrc:

export XMLNS_POM="http://maven.apache.org/POM/4.0.0"

If you look at the script I use xmlstarlet to extract the modules, the
project name and to compare the packaging type.

Cheers,
Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]