Continued: master
authorRoland Häder <roland@mxchange.org>
Tue, 9 Jan 2024 22:36:02 +0000 (23:36 +0100)
committerRoland Häder <roland@mxchange.org>
Tue, 9 Jan 2024 22:36:02 +0000 (23:36 +0100)
- updated year (not yet done everywhere else)
- add files before committing them

.gitattributes
.jprojects.sh
build-dist-all.sh
build-dist-cores.sh
build-dist-libs.sh
commit-jprojects.sh
fix-project-remotes.sh
make-javadoc.sh
pull-stick.sh
push-stick.sh
update-year-jprojects.sh

index 72184ce6eaa2f5cfb1e2d183953105fb520308bd..f720ce40c24fffeedacf552b4f7e5645f5d21328 100644 (file)
@@ -4,30 +4,33 @@
 # Autodetect text files
 * text=auto
 
-# Force the following filetypes to have unix eols, so Windows does not break them
-*.* text eol=lf
-
 # Force images/fonts to be handled as binaries
-*.jpg binary
-*.jpeg binary
-*.gif binary
-*.png binary
-*.t3x binary
-*.t3d binary
-*.exe binary
-*.data binary
-*.ttf binary
-*.eof binary
-*.eot binary
-*.swf binary
-*.mov binary
-*.mp4 binary
-*.mp3 binary
-*.ogg binary
-*.flv binary
-*.jar binary
-*.pdf binary
-*.woff* binary
-*.otf binary
-*.z binary
-*.docx binary
+*.jpg filter=lfs diff=lfs merge=lfs -text
+*.jpeg filter=lfs diff=lfs merge=lfs -text
+*.gif filter=lfs diff=lfs merge=lfs -text
+*.png filter=lfs diff=lfs merge=lfs -text
+*.t3x filter=lfs diff=lfs merge=lfs -text
+*.t3d filter=lfs diff=lfs merge=lfs -text
+*.exe filter=lfs diff=lfs merge=lfs -text
+*.data filter=lfs diff=lfs merge=lfs -text
+*.ttf filter=lfs diff=lfs merge=lfs -text
+*.eof filter=lfs diff=lfs merge=lfs -text
+*.eot filter=lfs diff=lfs merge=lfs -text
+*.swf filter=lfs diff=lfs merge=lfs -text
+*.mov filter=lfs diff=lfs merge=lfs -text
+*.mp4 filter=lfs diff=lfs merge=lfs -text
+*.mp3 filter=lfs diff=lfs merge=lfs -text
+*.ogg filter=lfs diff=lfs merge=lfs -text
+*.flv filter=lfs diff=lfs merge=lfs -text
+*.jar filter=lfs diff=lfs merge=lfs -text
+*.pdf filter=lfs diff=lfs merge=lfs -text
+*.woff* filter=lfs diff=lfs merge=lfs -text
+*.otf filter=lfs diff=lfs merge=lfs -text
+*.z filter=lfs diff=lfs merge=lfs -text
+*.docx filter=lfs diff=lfs merge=lfs -text
+
+# Force the following filetypes to have unix eols, so Windows does not break them
+*.java text eol=lf
+*.properties text eol=lf
+*.xml text eol=lf
+*.sh text eol=lf
index 673c5dc61f4b4812c7ec132bb925f1749ad1200d..156bbd3825d226f6273602716e6174597d7fa82d 100644 (file)
@@ -58,6 +58,10 @@ if [ -z "${ANT_BIN}" ]
 then
        echo "$0: Cannot find ANT binary."
        exit 1
+elif [ ! -x "${ANT_BIN}" ]
+then
+       echo "$0: '${ANT_BIN}' is not executable!"
+       exit 1
 elif [ -z "${SCP_BIN}" ]
 then
        echo "$0: Cannot find SCP binary."
@@ -73,11 +77,14 @@ LIST=""
 for project in ${ALL_PROJECTS}; do
        if [ ! -d "${project}" ]
        then
-               echo "$0: Project '${project}' not created."
+               echo "$0: WARNING: Project '${project}' not created."
        elif [ ! -f "${project}/.git/config" ]
        then
-               echo "$0: Project '${project}' is no GIT project."
+               echo "$0: ERROR: Project '${project}' is no GIT project."
                exit 1
+       elif [ "${project}" != "jprojects-scripts" -a ! -d "${JPROJECTS_HOME}/${project}/src/" ]
+       then
+               echo "$0: WARNING: Project '${project}' has no 'src' directory."
        fi
 
        # Add it as available
index 57775cafeb8e54053f37034fa29ac9e62c6c1480..a262c7fdfc7274bcfdbd3c857aa667c87368f90a 100755 (executable)
@@ -19,21 +19,23 @@ for project in ${LIST}; do
        echo "$0: P='${P}'"
        cd "${JPROJECTS_HOME}/${P}" || exit 255
 
-       if [ ! -e "build.xml" ]
+       if [ ! -f "build.xml" ]
        then
                echo "$0: No build.xml found, skipping project '${P}'."
                continue
        fi
 
-       if [ -x "${ANT_BIN}" -a "$1" != "d" ]
+       if [ "$1" != "d" ]
        then
                if [ "$1" = "c" ]
                then
                        # Cleanup
-                       ${ANT_BIN} clean
+                       echo "$0: Cleaning up '${project}' ..."
+                       "${ANT_BIN}" clean
                fi
 
                # Build JAR
+               echo "$0: Building JAR for '${project}' ..."
                "${ANT_BIN}" jar
 
                # Save status
index 2c702fcfb1f09f8d2dc1b8a69a417ecfad4ecb1a..f479bf9f15331bcc55b624f2b19b1b47dbea691e 100755 (executable)
@@ -19,43 +19,53 @@ for project in ${LIST}; do
                continue
        fi
 
-       echo "$0: Executing '${project}' ..."
        P=${project%/*}
-
        echo "$0: P='${P}'"
        cd "${JPROJECTS_HOME}/${P}" || exit 255
 
-       if [ ! -e "build.xml" ]
+       if [ ! -f "build.xml" ]
        then
                echo "$0: No build.xml found, skipping project '${P}'."
                continue
        fi
 
-       if [ -x "${ANT_BIN}" -a "$1" != "d" ]
+       if [ "$1" != "d" ]
        then
                if [ "$1" = "c" ]
                then
                        # Cleanup
-                       ${ANT_BIN} clean
+                       echo "$0: Cleaning up '${project}' ..."
+                       "${ANT_BIN}" clean
                fi
 
                # Build JAR
+               echo "$0: Building JAR for '${project}' ..."
                "${ANT_BIN}" jar
 
                # Save status
                STATUS="$?"
 
                # Has it failed?
+               echo "$0: STATUS='${STATUS}'"
                if [ "${STATUS}" != "0" ]
                then
-                       # This has failed, so try "dist"
-                       "${ANT_BIN}" dist
+                       echo "$0: Failed to build '${project}'."
+                       exit 1
+               fi
+
+               # Is a "test" directory there?
+               if [ -d "test" ]
+               then
+                       echo "$0: Running unit tests ..."
+                       "${ANT_BIN}" test
+
+                       # Save status
                        STATUS="$?"
 
-                       # Still failing? Oh, to bad
+                       # Has it failed?
                        if [ "${STATUS}" != "0" ]
                        then
-                               echo "$0: Failed to build '${project}'."
+                               echo "$0: Failed to test '${project}'."
                                exit 1
                        fi
                fi
index 0260908964e09c53f7055b06df2ae0cfe9997662..963971ec8013d2675e91d94a91b5827c14f2329b 100755 (executable)
@@ -25,21 +25,23 @@ for project in ${LIST}; do
        echo "$0: P='${P}'"
        cd "${JPROJECTS_HOME}/${P}" || exit 255
 
-       if [ ! -e "build.xml" ]
+       if [ ! -f "build.xml" ]
        then
                echo "$0: No build.xml found, skipping project '${P}'."
                continue
        fi
 
-       if [ -x "${ANT_BIN}" -a "$1" != "d" ]
+       if [ "$1" != "d" ]
        then
                if [ "$1" = "c" ]
                then
                        # Cleanup
-                       ${ANT_BIN} clean
+                       echo "$0: Cleaning up '${project}' ..."
+                       "${ANT_BIN}" clean
                fi
 
                # Build JAR
+               echo "$0: Building JAR for '${project}' ..."
                "${ANT_BIN}" jar
 
                # Save status
index 88ec307def8d200c8b96462565b891da7635d86d..48ce900ff5bee48b3762047e7357e838cc0e5bf9 100755 (executable)
@@ -22,6 +22,7 @@ for project in ${LIST}; do
                if [ "$1" = "updated jar(s)" ]
                then
                        # Special commit ... (known-binaries)
+                       git add lib/ || exit 255
                        git commit --signoff -S lib/*.jar -m "$1"
                elif [ "$1" = "updated dist.sh" ]
                then
@@ -30,10 +31,12 @@ for project in ${LIST}; do
                elif [ -n "$1" -a -n "$2" ]
                then
                        # Regular commit with given message
+                       git add $2 || exit 255
                        git commit $2 --signoff -S -m "$1" || exit 255
                elif [ -d "$1" -o -f "$1" ]
                then
                        # Limited commit with no message
+                       git add $1 || exit 255
                        git commit $1 --signoff -S || exit 255
                elif [ -n "$1" ]
                then
index e8b6ec30d8e2174d7b32737bd1a601af21c22ebb..b51bd975b15f76f28c56ee90130d0a6bbe3e6b4f 100755 (executable)
@@ -3,7 +3,7 @@
 . ./.jprojects.sh || exit 255
 
 UNWANTED_NAME1="stick"
-UNWANTED_NAME2="jtrainings"
+UNWANTED_NAME2="jjobboards"
 WANTED_NAME1="upstream"
 WANTED_NAME2="daedalus"
 WANTED_NAME3="transport"
@@ -227,19 +227,9 @@ for project in ${LIST}; do
 
        if [ -n "${UNWANTED_REMOTE}" ]
        then
-               echo "$0: Found remote '${UNWANTED_NAME2}' in '${project}'. Renaming '${GIT_ORIGIN}'->'${WANTED_NAME1}' and '${UNWANTED_NAME2}'->'${GIT_ORIGIN}' ..."
+               echo "$0: Found remote '${UNWANTED_NAME2}' in '${project}'. Removing it..."
 
-               UPSTREAM_REMOTE=$(git remote | grep "${WANTED_NAME1}")
-               echo "$0: UPSTREAM_REMOTE='${UPSTREAM_REMOTE}'"
-
-               if [ -n "${UPSTREAM_REMOTE}" ]
-               then
-                       echo "$0: Remotes '${UNWANTED_NAME2}' and '${WANTED_NAME1}' exist! Removing '${WANTED_NAME1}' ..."
-                       git remote rm "${WANTED_NAME1}" || exit 255
-               fi
-
-               git remote rename "${GIT_ORIGIN}" "${WANTED_NAME1}" || exit 255
-               git remote rename "${UNWANTED_NAME2}" "${GIT_ORIGIN}" || exit 255
+               git remote remove "${UNWANTED_REMOTE}" || exit 255
        else
                echo "$0: No unwanted '${UNWANTED_NAME2}' remote in '${project}' ..."
                UPSTREAM_REMOTE1=$(git remote | grep "${WANTED_NAME1}")
index bf6efec8ccb02543ee0866e7bac382dd3b920da3..92db6f6204585c921189d07f8f974cf10019d8ae 100755 (executable)
@@ -42,8 +42,24 @@ for project in ${LIST}; do
        echo "$0: Cleaning up Javadoc for '${project}' ..."
        rm -rf dist/javadoc/
 
+       M=$(echo "${UNMAINTAINED}" | grep "${project}")
+       B=$(echo "${BROKEN}" | grep "${project}")
+       if [ -f "src/.gitkeep" ]
+       then
+               echo "$0: project='${project}' has a .gitkeep file in 'src', won't scan."
+               continue
+       elif [ -n "${M}" ]
+       then
+               echo "$0: Skipping unmaintained project='${project}' ..."
+               continue
+       elif [ -n "${B}" ]
+       then
+               echo "$0: Skipping broken project='${project}' ..."
+               continue
+       fi
+
        echo "$0: Generating documentation for '${project}' ..."
-       ${ANT_BIN} javadoc > dist/javadoc.log || exit 255
+       "${ANT_BIN}" javadoc > dist/javadoc.log || exit 255
        rm -fv dist/javadoc.log
 
        IS_COMPANY_PROJECT=$(echo "${COMPANY_PROJECTS}" | grep "${project}")
index f1f16dd37f9d3f0b5e9abfde61677d510b5d967f..3406617efd9b1cb6f6a2e26782688d34a8f76fa9 100755 (executable)
@@ -19,23 +19,27 @@ for project in ${LIST}; do
        if [ "$1" = "c" ]
        then
                echo "$0: Checkout '${project}' ..."
-               git checkout -- .
+               git checkout -- . || exit 255
        elif [ "$1" = "r" ]
        then
                echo "$0: Resetting '${project}' ..."
-               git reset --hard
+               git reset --hard || exit 255
        fi
 
        echo "$0: Pulling '${project}' ..."
-
-       git pull -S origin master
-       git fetch upstream
-       git fetch transport
+       if [ "$1" = "a" ]
+       then
+               git pull --all || exit 255
+       else
+               git pull -S origin master || exit 255
+               git fetch upstream || exit 255
+               git fetch transport || exit 255
+       fi
 
        echo "$0: Merging upstream into '${project}' ..."
-       git merge -S upstream/master
+       git merge -S upstream/master || exit 255
 
-       if [ "$1" != "s" ]
+       if [ "$1" != "s" -a "$1" != "a" ]
        then
                echo "$0: Rebasing '${project}' ..."
                git rebase -Sm origin/master || exit 255
index 1fcc7dcde7fe754bbb929e822a995a61aecff977..3c02302d81210e9e45b47985dbb25872b3a2ac43 100755 (executable)
@@ -55,6 +55,14 @@ for project in ${LIST}; do
                fi
 
                git push ${FORCE} --all upstream || exit 255
+       elif [ "$1" = "o" ]
+       then
+               if [ -n "$2" ]
+               then
+                       git push origin :"$2"
+               fi
+
+               git push ${FORCE} --all origin || exit 255
        else
                if [ -n "$2" ]
                then
index e43cf52a42a0d70d1518f0d9ce8d23bb4844db26..ea825545e11f366006d9f437b6efcb6203a7975c 100755 (executable)
@@ -19,10 +19,8 @@ for project in ${LIST}; do
 
        echo "$0: Updating (c) year in '${project}' ..."
        # Update both years when a new year has reached
-       find */ -type f -print0 | xargs -0 sed -i 's/2016, 2020/2016 - 2020/g'
-       find */ -type f -print0 | xargs -0 sed -i 's/2017, 2020/2017 - 2020/g'
-       find */ -type f -print0 | xargs -0 sed -i 's/2017 Free Software/2020 Free Software/g'
-       find */ -type f -print0 | xargs -0 sed -i 's/2017 Roland Häder/2020 Free Software Foundation/g'
+       find */ -type f -print0 | xargs -0 sed -i 's/2020, 2023/2020 - 2024/g'
+       find */ -type f -print0 | xargs -0 sed -i 's/2023 Free Software/2024 Free Software/g'
 
        DIFF=$(git diff)