mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
update embedding interfaces mod.rs generator script to add MPL
also use better zsh syntax
This commit is contained in:
parent
ad91db7224
commit
ff6667f564
1 changed files with 14 additions and 2 deletions
16
ports/cef/regen_interface_mod_rs.sh
Normal file → Executable file
16
ports/cef/regen_interface_mod_rs.sh
Normal file → Executable file
|
@ -1,7 +1,19 @@
|
||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
|
||||||
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
|
||||||
|
setopt extended_glob
|
||||||
|
echo -e $(cat << END_MPL
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public\n
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this\n
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n
|
||||||
|
END_MPL) >>| interfaces_mod.rs
|
||||||
|
|
||||||
# loop all files in interfaces dir
|
# loop all files in interfaces dir
|
||||||
for x in interfaces/^*mod.rs
|
for x in $(print interfaces/*.rs~interfaces/mod.rs)
|
||||||
do
|
do
|
||||||
# open the use statement
|
# open the use statement
|
||||||
echo -n "pub use interfaces::$(basename $x .rs)::{" >>| interfaces_mod.rs
|
echo -n "pub use interfaces::$(basename $x .rs)::{" >>| interfaces_mod.rs
|
||||||
|
@ -26,7 +38,7 @@ grep -E '^pub struct Cef' types.rs|sed 's/pub struct \([^ ]*\) .*/pub use types:
|
||||||
# newline separators
|
# newline separators
|
||||||
echo -e '\n\n' >>| interfaces_mod.rs
|
echo -e '\n\n' >>| interfaces_mod.rs
|
||||||
# loop all files in interfaces dir again
|
# loop all files in interfaces dir again
|
||||||
for x in interfaces/^*mod.rs
|
for x in $(print interfaces/*.rs~interfaces/mod.rs)
|
||||||
do
|
do
|
||||||
# add mod statements for all interfaces
|
# add mod statements for all interfaces
|
||||||
echo "pub mod $(basename $x .rs);" >>| interfaces_mod.rs
|
echo "pub mod $(basename $x .rs);" >>| interfaces_mod.rs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue