|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# |
| 4 | +# buildIntelliJModules.sh - generates the IntelliJ modules for JDK 9. |
| 5 | +# |
| 6 | +# Copyright (c) 2014, Will May <will.j.may@gmail.com> All rights reserved. |
| 7 | +# |
| 8 | +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 9 | +# |
| 10 | +# This code is free software; you can redistribute it and/or modify it |
| 11 | +# under the terms of the GNU General Public License version 2 only, as |
| 12 | +# published by the Free Software Foundation. Oracle designates this |
| 13 | +# particular file as subject to the "Classpath" exception as provided |
| 14 | +# by Oracle in the LICENSE file that accompanied this code. |
| 15 | +# |
| 16 | +# This code is distributed in the hope that it will be useful, but WITHOUT |
| 17 | +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 18 | +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 19 | +# version 2 for more details (a copy is included in the LICENSE file that |
| 20 | +# accompanied this code). |
| 21 | +# |
| 22 | +# You should have received a copy of the GNU General Public License version |
| 23 | +# 2 along with this work; if not, write to the Free Software Foundation, |
| 24 | +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 25 | +# |
| 26 | + |
| 27 | +pushd /home/openjdk/dev/jdk9_dev/jdk |
| 28 | +for D in src/*; do |
| 29 | + moduleName=`basename $D` |
| 30 | + echo '<?xml version="1.0" encoding="UTF-8"?>' > $moduleName.iml |
| 31 | + echo '<module type="JAVA_MODULE" version="4">' >> $moduleName.iml |
| 32 | + echo ' <component name="NewModuleRootManager" inherit-compiler-output="false">' >> $moduleName.iml |
| 33 | + echo " <output url=\"file://\$MODULE_DIR\$/../build/linux-x86_64-normal-server-release/jdk/modules/$moduleName\" />" >> $moduleName.iml |
| 34 | + echo " <output-test url=\"file://\$MODULE_DIR\$/out/test/$moduleName\" />" >> $moduleName.iml |
| 35 | + echo ' <exclude-output />' >> $moduleName.iml |
| 36 | + echo " <content url=\"file://\$MODULE_DIR\$/$D\">" >> $moduleName.iml |
| 37 | + if [ -e $D/share/classes ]; then |
| 38 | + echo " <sourceFolder url=\"file://\$MODULE_DIR\$/$D/share/classes\" isTestSource=\"false\" />" >> $moduleName.iml |
| 39 | + fi |
| 40 | + if [ -e $D/unix/classes ]; then |
| 41 | + echo " <sourceFolder url=\"file://\$MODULE_DIR\$/$D/unix/classes\" isTestSource=\"false\" />" >> $moduleName.iml |
| 42 | + fi |
| 43 | + if [ -e $D/linux/classes ]; then |
| 44 | + echo " <sourceFolder url=\"file://\$MODULE_DIR\$/$D/linux/classes\" isTestSource=\"false\" />" >> $moduleName.iml |
| 45 | + fi |
| 46 | + if [ -e $D/share/native ]; then |
| 47 | + echo " <sourceFolder url=\"file://\$MODULE_DIR\$/$D/share/native\" isTestSource=\"false\" />" >> $moduleName.iml |
| 48 | + fi |
| 49 | + if [ -e $D/unix/native ]; then |
| 50 | + echo " <sourceFolder url=\"file://\$MODULE_DIR\$/$D/unix/native\" isTestSource=\"false\" />" >> $moduleName.iml |
| 51 | + fi |
| 52 | + if [ -e $D/linux/native ]; then |
| 53 | + echo " <sourceFolder url=\"file://\$MODULE_DIR\$/$D/linux/native\" isTestSource=\"false\" />" >> $moduleName.iml |
| 54 | + fi |
| 55 | + if [ -e $D/share/conf ]; then |
| 56 | + echo " <sourceFolder url=\"file://\$MODULE_DIR\$/$D/share/conf\" type=\"java-resource\" />" >> $moduleName.iml |
| 57 | + fi |
| 58 | + if [ -e $D/unix/conf ]; then |
| 59 | + echo " <sourceFolder url=\"file://\$MODULE_DIR\$/$D/unix/conf\" type=\"java-resource\" />" >> $moduleName.iml |
| 60 | + fi |
| 61 | + if [ -e $D/linux/conf ]; then |
| 62 | + echo " <sourceFolder url=\"file://\$MODULE_DIR\$/$D/linux/conf\" type=\"java-resource\" />" >> $moduleName.iml |
| 63 | + fi |
| 64 | + echo ' </content>' >> $moduleName.iml |
| 65 | + echo ' <orderEntry type="inheritedJdk" />' >> $moduleName.iml |
| 66 | + echo ' <orderEntry type="sourceFolder" forTests="false" />' >> $moduleName.iml |
| 67 | + echo ' </component>' >> $moduleName.iml |
| 68 | + echo '</module>' >> $moduleName.iml |
| 69 | +done |
| 70 | +popd |
0 commit comments