equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
245 public Path write(Path srcDir) throws IOException { |
245 public Path write(Path srcDir) throws IOException { |
246 Files.createDirectories(srcDir); |
246 Files.createDirectories(srcDir); |
247 List<String> sources = new ArrayList<>(); |
247 List<String> sources = new ArrayList<>(); |
248 StringBuilder sb = new StringBuilder(); |
248 StringBuilder sb = new StringBuilder(); |
249 if (!comment.isEmpty()) { |
249 if (!comment.isEmpty()) { |
250 sb.append("/**\n").append(comment.replace("\n", " *")).append(" */\n"); |
250 sb.append("/**\n * ") |
|
251 .append(comment.replace("\n", "\n * ")) |
|
252 .append("\n */\n"); |
251 } |
253 } |
252 sb.append("module ").append(name).append(" {\n"); |
254 sb.append("module ").append(name).append(" {\n"); |
253 requires.forEach(r -> sb.append(" " + r + "\n")); |
255 requires.forEach(r -> sb.append(" " + r + "\n")); |
254 exports.forEach(e -> sb.append(" " + e + "\n")); |
256 exports.forEach(e -> sb.append(" " + e + "\n")); |
255 uses.forEach(u -> sb.append(" " + u + "\n")); |
257 uses.forEach(u -> sb.append(" " + u + "\n")); |