NpmPackageToProjectAdapter.java 文件源码

java
阅读 17 收藏 0 点赞 0 评论 0

项目:n4js 作者:
/**
 * Writes contents of the {@link N4MFConstants#N4MF_MANIFEST manifest file} for a given npm package.
 *
 * @param projectFolder
 *            root folder of the npm package in which manifest is written
 * @param packageJSON
 *            that will be used as manifest data source
 * @param mainModule
 *            the main module
 * @param manifest
 *            file to which contents should be written
 *
 */
private void generateManifestContent(File projectFolder, PackageJson packageJSON, String mainModule,
        File manifest)
        throws IOException {

    String projectId = packageJSON.name;
    String projectVersion = packageJSON.version;

    if (!projectFolder.getName().equals(projectId)) {
        LOGGER.warn("project folder and project name are different : " + projectFolder.getName() + " <> + "
                + packageJSON.name);
    }

    try (FileWriter fw = new FileWriter(manifest)) {
        fw.write(manifestContentProvider.getContent(projectId, ".", ".", mainModule, projectVersion));
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号