• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# This code is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 2 only, as
7# published by the Free Software Foundation.  Oracle designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Oracle in the LICENSE file that accompanied this code.
10#
11# This code is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14# version 2 for more details (a copy is included in the LICENSE file that
15# accompanied this code).
16#
17# You should have received a copy of the GNU General Public License version
18# 2 along with this work; if not, write to the Free Software Foundation,
19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22# or visit www.oracle.com if you need additional information or have any
23# questions.
24#
25
26GENSRC_CHARSETCODER :=
27
28GENSRC_CHARSETCODER_DST := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/nio/charset
29
30# Android-changed: ojluni/ doesn't have java.base/ directory.
31# GENSRC_CHARSETCODER_SRC := $(TOPDIR)/src/java.base/share/classes/java/nio
32
33GENSRC_CHARSETCODER_TEMPLATE := $(GENSRC_CHARSETCODER_SRC)/charset/Charset-X-Coder.java.template
34
35################################################################################
36
37$(GENSRC_CHARSETCODER_DST)/CharsetDecoder.java: $(GENSRC_CHARSETCODER_TEMPLATE)
38	$(call MakeTargetDir)
39	$(RM) $@.tmp
40	$(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/gensrc/java.base/_charset_decoder, \
41	    $(TOOL_SPP) -i$< -o$@.tmp \
42	    -Kdecoder \
43	    -DA='A' \
44	    -Da='a' \
45	    -DCode='Decode' \
46	    -Dcode='decode' \
47	    -DitypesPhrase='bytes in a specific charset' \
48	    -DotypesPhrase='sixteen-bit Unicode characters' \
49	    -Ditype='byte' \
50	    -Dotype='character' \
51	    -DItype='Byte' \
52	    -DOtype='Char' \
53	    -Dcoder='decoder' \
54	    -DCoder='Decoder' \
55	    -Dcoding='decoding' \
56	    -DOtherCoder='Encoder' \
57	    -DreplTypeName='string' \
58	    -DdefaultRepl='"\\uFFFD"' \
59	    -DdefaultReplName='<code>"\&#92;uFFFD"<\/code>' \
60	    -DreplType='String' \
61	    -DreplFQType='java.lang.String' \
62	    -DreplLength='length()' \
63	    -DItypesPerOtype='CharsPerByte' \
64	    -DnotLegal='not legal for this charset' \
65	    -Dotypes-per-itype='chars-per-byte' \
66	    -DoutSequence='Unicode character')
67	$(MV) $@.tmp $@
68
69GENSRC_CHARSETCODER += $(GENSRC_CHARSETCODER_DST)/CharsetDecoder.java
70
71################################################################################
72
73$(GENSRC_CHARSETCODER_DST)/CharsetEncoder.java: $(GENSRC_CHARSETCODER_TEMPLATE)
74	$(call MakeTargetDir)
75	$(RM) $@.tmp
76	$(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/gensrc/java.base/_charset_encoder, \
77	    $(TOOL_SPP) -i$< -o$@.tmp \
78	    -Kencoder \
79	    -DA='An' \
80	    -Da='an' \
81	    -DCode='Encode' \
82	    -Dcode='encode' \
83	    -DitypesPhrase='sixteen-bit Unicode characters' \
84	    -DotypesPhrase='bytes in a specific charset' \
85	    -Ditype='character' \
86	    -Dotype='byte' \
87	    -DItype='Char' \
88	    -DOtype='Byte' \
89	    -Dcoder='encoder' \
90	    -DCoder='Encoder' \
91	    -Dcoding='encoding' \
92	    -DOtherCoder='Decoder' \
93	    -DreplTypeName='byte array' \
94	    -DdefaultRepl='new byte[] { (byte)'"'"\\?"'"' }' \
95	    -DdefaultReplName='<code>{<\/code>\&nbsp;<code>(byte)'"'"\\?"'"'<\/code>\&nbsp;<code>}<\/code>' \
96	    -DreplType='byte[]' \
97	    -DreplFQType='byte[]' \
98	    -DreplLength='length' \
99	    -DItypesPerOtype='BytesPerChar' \
100	    -DnotLegal='not a legal sixteen-bit Unicode sequence' \
101	    -Dotypes-per-itype='bytes-per-char' \
102	    -DoutSequence='byte sequence in the given charset')
103	$(MV) $@.tmp $@
104
105GENSRC_CHARSETCODER += $(GENSRC_CHARSETCODER_DST)/CharsetEncoder.java
106
107################################################################################
108
109$(GENSRC_CHARSETCODER): $(BUILD_TOOLS_JDK)
110
111TARGETS += $(GENSRC_CHARSETCODER)
112