File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -382,6 +382,26 @@ if [ -d "$SOURCE_REPO_NAME/.github/workflows" ]; then
382382 COMMIT_COUNT=$(( COMMIT_COUNT + 1 ))
383383fi
384384
385+ # 7.5c Inject root .gitignore negative overrides to protect Java package folders from env/ string collisions
386+ if [ -f " .gitignore" ]; then
387+ echo " Injecting negative override allow rules into root .gitignore to protect Java env/ package namespaces..."
388+ cat << EOF >> ".gitignore"
389+
390+ # Protect Java package folders from Python virtualenv env/ and ENV/ blanket collisions
391+ !**/src/main/java/**/env/
392+ !**/src/test/java/**/env/
393+ !**/src/main/proto/**/env/
394+ !**/src/test/proto/**/env/
395+ !**/src/main/java/**/ENV/
396+ !**/src/test/java/**/ENV/
397+ EOF
398+
399+ echo " Committing root .gitignore negative overrides..."
400+ git add .gitignore
401+ git commit -n --no-gpg-sign -m " chore($SOURCE_REPO_NAME ): inject gitignore negative overrides to shield java env packages"
402+ COMMIT_COUNT=$(( COMMIT_COUNT + 1 ))
403+ fi
404+
385405# 7.6 Update generation_config.yaml
386406echo " Updating generation_config.yaml..."
387407SOURCE_CONFIG=" $SOURCE_REPO_NAME /generation_config.yaml"
You can’t perform that action at this time.
0 commit comments