Skip to content
This repository was archived by the owner on Oct 1, 2025. It is now read-only.

Commit dfcf70d

Browse files
committed
8210283: Support git as an SCM alternative in the build
Removes forest handling of SCM ids Reviewed-by: mikael, tbell Backport-of: 054b85b1f65254b2d3d2a1d343e14d8eabd1af40
1 parent 87770b0 commit dfcf70d

File tree

5 files changed

+79
-5
lines changed

5 files changed

+79
-5
lines changed

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/build/
2+
/dist/
3+
/.idea/
4+
nbproject/private/
5+
/webrev
6+
/.src-rev
7+
/.jib/
8+
/.hgtip
9+
.DS_Store
10+
.metadata/
11+
.recommenders/
12+
test/nashorn/script/external
13+
test/nashorn/lib
14+
NashornProfile.txt
15+
**/JTreport/**
16+
**/JTwork/**
17+
/jdk/make/closed/
18+
/jdk/src/closed/

common/autoconf/basics.m4

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -640,6 +640,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
640640
fi
641641
AC_PATH_PROGS(READELF, [readelf greadelf])
642642
AC_PATH_PROG(HG, hg)
643+
AC_PATH_PROG(GIT, git)
643644
AC_PATH_PROG(STAT, stat)
644645
AC_PATH_PROG(TIME, time)
645646
# Check if it's GNU time

common/autoconf/generated-configure.sh

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,7 @@ DSYMUTIL
832832
IS_GNU_TIME
833833
TIME
834834
STAT
835+
GIT
835836
HG
836837
READELF
837838
OTOOL
@@ -3108,7 +3109,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
31083109

31093110
# Include these first...
31103111
#
3111-
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
3112+
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
31123113
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
31133114
#
31143115
# This code is free software; you can redistribute it and/or modify it
@@ -3872,7 +3873,7 @@ fi
38723873
#CUSTOM_AUTOCONF_INCLUDE
38733874

38743875
# Do not change or remove the following line, it is needed for consistency checks:
3875-
DATE_WHEN_GENERATED=1573688723
3876+
DATE_WHEN_GENERATED=1649266272
38763877

38773878
###############################################################################
38783879
#
@@ -10449,6 +10450,46 @@ $as_echo "no" >&6; }
1044910450
fi
1045010451

1045110452

10453+
# Extract the first word of "git", so it can be a program name with args.
10454+
set dummy git; ac_word=$2
10455+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10456+
$as_echo_n "checking for $ac_word... " >&6; }
10457+
if ${ac_cv_path_GIT+:} false; then :
10458+
$as_echo_n "(cached) " >&6
10459+
else
10460+
case $GIT in
10461+
[\\/]* | ?:[\\/]*)
10462+
ac_cv_path_GIT="$GIT" # Let the user override the test with a path.
10463+
;;
10464+
*)
10465+
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10466+
for as_dir in $PATH
10467+
do
10468+
IFS=$as_save_IFS
10469+
test -z "$as_dir" && as_dir=.
10470+
for ac_exec_ext in '' $ac_executable_extensions; do
10471+
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
10472+
ac_cv_path_GIT="$as_dir/$ac_word$ac_exec_ext"
10473+
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
10474+
break 2
10475+
fi
10476+
done
10477+
done
10478+
IFS=$as_save_IFS
10479+
10480+
;;
10481+
esac
10482+
fi
10483+
GIT=$ac_cv_path_GIT
10484+
if test -n "$GIT"; then
10485+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIT" >&5
10486+
$as_echo "$GIT" >&6; }
10487+
else
10488+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10489+
$as_echo "no" >&6; }
10490+
fi
10491+
10492+
1045210493
# Extract the first word of "stat", so it can be a program name with args.
1045310494
set dummy stat; ac_word=$2
1045410495
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5

common/autoconf/spec.gmk.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ READELF:=@READELF@
533533
EXPR:=@EXPR@
534534
FILE:=@FILE@
535535
HG:=@HG@
536+
GIT:=@GIT@
536537
OBJCOPY:=@OBJCOPY@
537538
SETFILE:=@SETFILE@
538539
XATTR:=@XATTR@

make/common/MakeBase.gmk

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,13 @@ endef
299299
# These should not be := assignments, only used from the root Makefile.
300300
HG_VERSION = $(shell $(HG) version 2> /dev/null)
301301
HG_DIRECTORY=.hg
302+
GIT_DIRECTORY=.git
302303
HGTIP_FILENAME=.hgtip
303304
HG_SEARCH = ./REPO ./*/REPO ./*/*/REPO ./*/*/*/REPO
304305
REPO_LIST = $(patsubst ./%,%,$(patsubst %/,%,$(sort $(dir \
305-
$(shell $(CD) $(SRC_ROOT) ; ( $(LS) -d $(HG_SEARCH:%/REPO=%/$(HG_DIRECTORY)) ; \
306+
$(shell $(CD) $(SRC_ROOT) ; ( \
307+
$(LS) -d $(HG_SEARCH:%/REPO=%/$(HG_DIRECTORY)) ; \
308+
$(LS) -d $(HG_SEARCH:%/REPO=%/$(GIT_DIRECTORY)) ; \
306309
$(LS) $(HG_SEARCH:%/REPO=%/$(HGTIP_FILENAME)) ) \
307310
2> /dev/null)))))
308311

@@ -315,6 +318,12 @@ define GetSourceTips
315318
elif [ -d $${i}/$(HG_DIRECTORY) -a "$(HG_VERSION)" != "" ] ; then \
316319
$(PRINTF) " %s:%s" \
317320
"$${i}" `$(HG) tip --repository $${i} --template '{node|short}\n'` ; \
321+
elif [ -d $${i}/$(GIT_DIRECTORY) -a "$(GIT)" != "" ] ; then \
322+
porcelain="`$(GIT) -C $${i} status --porcelain`" ; \
323+
$(PRINTF) " %s:%s%s\n" \
324+
"$${i}" \
325+
"`$(GIT) -C $${i} log -n1 --format=%H | $(CUT) -c1-12`" \
326+
"`if test -n \"$${porcelain}\"; then printf '+'; fi`" ; \
318327
elif [ -f $${i}/$(HGTIP_FILENAME) ] ; then \
319328
$(PRINTF) " %s:%s" \
320329
"$${i}" `$(CAT) $${i}/$(HGTIP_FILENAME)` ; \
@@ -325,7 +334,11 @@ endef
325334

326335
# Create the HGTIP_FILENAME file. Called from jdk/make/closed/bundles.gmk
327336
define CreateHgTip
328-
$(HG) tip --repository $1 --template '{node|short}\n' > $1/$(HGTIP_FILENAME); \
337+
if [ -d $1/$(HG_DIRECTORY) -a "$(HG_VERSION)" != "" ] ; then \
338+
$(HG) tip --repository $1 --template '{node|short}\n' > $1/$(HGTIP_FILENAME); \
339+
elif [ -d $1/$(GIT_DIRECTORY) -a "$(GIT)" != "" ] ; then \
340+
$(GIT) -C $1 log -n1 --format=%H | $(CUT) -c1-12 > $1/$(HGTIP_FILENAME); \
341+
fi ; \
329342
$(ECHO) $1/$(HGTIP_FILENAME)
330343
endef
331344

0 commit comments

Comments
 (0)