Support running soong_ui.bash from anywhere in the tree
It will cd to $TOP before running soong_ui itself, so that soong_ui still runs from the top of the tree. ORIGINAL_PWD is saved so that we can reference that later (for example, to move 'mma' implementation into Go). Test: cd system; ../build/soong/soong_ui.bash Test: Set absolute / relative OUT_DIR or OUT_DIR_COMMON_BASE and repeat Change-Id: Icb67a3ee6a3358cca50300755c8953419fc19437
This commit is contained in:
@@ -39,9 +39,12 @@ function getoutdir
|
|||||||
if [ "${OUT_DIR_COMMON_BASE-}" ]; then
|
if [ "${OUT_DIR_COMMON_BASE-}" ]; then
|
||||||
out_dir="${OUT_DIR_COMMON_BASE}/$(basename ${TOP})"
|
out_dir="${OUT_DIR_COMMON_BASE}/$(basename ${TOP})"
|
||||||
else
|
else
|
||||||
out_dir="${TOP}/out"
|
out_dir="out"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if [[ "${out_dir}" != /* ]]; then
|
||||||
|
out_dir="${TOP}/${out_dir}"
|
||||||
|
fi
|
||||||
echo "${out_dir}"
|
echo "${out_dir}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -47,8 +47,12 @@ function gettop
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Save the current PWD for use in soong_ui
|
||||||
|
export ORIGINAL_PWD=${PWD}
|
||||||
export TOP=$(gettop)
|
export TOP=$(gettop)
|
||||||
source build/soong/cmd/microfactory/microfactory.bash
|
source ${TOP}/build/soong/cmd/microfactory/microfactory.bash
|
||||||
|
|
||||||
build_go soong_ui android/soong/cmd/soong_ui
|
build_go soong_ui android/soong/cmd/soong_ui
|
||||||
|
|
||||||
|
cd ${TOP}
|
||||||
exec "$(getoutdir)/soong_ui" "$@"
|
exec "$(getoutdir)/soong_ui" "$@"
|
||||||
|
Reference in New Issue
Block a user