Пример #1
0
def maven_plugin_install(args):
    # First install native-image-maven-plugin dependencies into local maven repository
    svmVersion = suite.release_version(snapshotSuffix='SNAPSHOT')
    mx.maven_deploy([
        '--suppress-javadoc',
        '--all-distribution-types',
        '--validate=full',
        '--all-suites',
        '--skip-existing',
    ])

    deploy_native_image_maven_plugin(svmVersion)

    success_message = [
        '',
        'Use the following plugin snippet to enable native-image building for your maven project:',
        '',
        '<plugin>',
        '    <groupId>com.oracle.substratevm</groupId>',
        '    <artifactId>native-image-maven-plugin</artifactId>',
        '    <version>' + svmVersion + '</version>',
        '    <executions>',
        '        <execution>',
        '            <goals>',
        '                <goal>native-image</goal>',
        '            </goals>',
        '            <phase>package</phase>',
        '        </execution>',
        '    </executions>',
        '</plugin>',
        '',
    ]
    mx.log('\n'.join(success_message))
Пример #2
0
def maven_plugin_install(args):
    # First install native-image-maven-plugin dependencies into local maven repository
    deps = []

    def visit(dep, edge):
        if isinstance(dep, mx.Distribution):
            deps.append(dep)

    mx.walk_deps([mx.dependency('substratevm:SVM_DRIVER')],
                 visit=visit,
                 ignoredEdges=[mx.DEP_ANNOTATION_PROCESSOR, mx.DEP_BUILD])
    svmVersion = '{0}-SNAPSHOT'.format(suite.vc.parent(suite.vc_dir))
    mx.maven_deploy([
        '--version-string', svmVersion, '--suppress-javadoc',
        '--all-distributions', '--validate=none', '--all-suites',
        '--skip-existing', '--only', ','.join(dep.qualifiedName()
                                              for dep in deps)
    ])

    deploy_native_image_maven_plugin(svmVersion)

    success_message = [
        '',
        'Use the following plugin snippet to enable native-image building for your maven project:',
        '',
        '<plugin>',
        '    <groupId>com.oracle.substratevm</groupId>',
        '    <artifactId>native-image-maven-plugin</artifactId>',
        '    <version>' + svmVersion + '</version>',
        '    <executions>',
        '        <execution>',
        '            <goals>',
        '                <goal>native-image</goal>',
        '            </goals>',
        '            <phase>package</phase>',
        '        </execution>',
        '    </executions>',
        '</plugin>',
        '',
    ]
    mx.log('\n'.join(success_message))
Пример #3
0
def maven_plugin_install(args):
    # First install native-image-maven-plugin dependencies into local maven repository
    deps = []
    def visit(dep, edge):
        if isinstance(dep, mx.Distribution):
            deps.append(dep)
    mx.walk_deps([mx.dependency('substratevm:SVM_DRIVER')], visit=visit, ignoredEdges=[mx.DEP_ANNOTATION_PROCESSOR, mx.DEP_BUILD])
    svmVersion = '{0}-SNAPSHOT'.format(suite.vc.parent(suite.vc_dir))
    mx.maven_deploy([
        '--version-string', svmVersion,
        '--suppress-javadoc',
        '--all-distributions',
        '--validate=none',
        '--all-suites',
        '--skip-existing',
        '--only', ','.join(dep.qualifiedName() for dep in deps)
    ])

    deploy_native_image_maven_plugin(svmVersion)

    success_message = [
        '',
        'Use the following plugin snippet to enable native-image building for your maven project:',
        '',
        '<plugin>',
        '    <groupId>com.oracle.substratevm</groupId>',
        '    <artifactId>native-image-maven-plugin</artifactId>',
        '    <version>' + svmVersion + '</version>',
        '    <executions>',
        '        <execution>',
        '            <goals>',
        '                <goal>native-image</goal>',
        '            </goals>',
        '            <phase>package</phase>',
        '        </execution>',
        '    </executions>',
        '</plugin>',
        '',
    ]
    mx.log('\n'.join(success_message))
Пример #4
0
def maven_plugin_install(args):
    parser = ArgumentParser(prog='mx maven-plugin-install')
    parser.add_argument(
        "--deploy-dependencies",
        action='store_true',
        help=
        "This will deploy all the artifacts from all suites before building and deploying the plugin"
    )
    parser.add_argument(
        '--licenses',
        help=
        'Comma-separated list of licenses that are cleared for upload. Only used if no url is given. Otherwise licenses are looked up in suite.py'
    )
    parser.add_argument('--gpg',
                        action='store_true',
                        help='Sign files with gpg before deploying')
    parser.add_argument(
        '--gpg-keyid',
        help='GPG keyid to use when signing files (implies --gpg)',
        default=None)
    parser.add_argument(
        'repository_id',
        metavar='repository-id',
        nargs='?',
        action='store',
        help=
        'Repository ID used for binary deploy. If none is given, mavens local repository is used instead.'
    )
    parser.add_argument(
        'url',
        metavar='repository-url',
        nargs='?',
        action='store',
        help=
        'Repository URL used for binary deploy. If no url is given, the repository-id is looked up in suite.py'
    )
    parsed = parser.parse_args(args)

    if not suite.isSourceSuite():
        raise mx.abort(
            "maven-plugin-install requires {} to be a source suite, no a binary suite"
            .format(suite.name))

    if parsed.url:
        if parsed.licenses:
            licenses = mx.get_license(parsed.licenses.split(','))
        elif parsed.repository_id:
            licenses = mx.repository(parsed.repository_id).licenses
        else:
            licenses = []
        repo = mx.Repository(suite, parsed.repository_id, parsed.url,
                             parsed.url, licenses)
    elif parsed.repository_id:
        repo = mx.repository(parsed.repository_id)
    else:
        repo = mx.maven_local_repository()

    svm_version = suite.release_version(snapshotSuffix='SNAPSHOT')

    if parsed.deploy_dependencies:
        deploy_args = [
            '--suppress-javadoc',
            '--all-distribution-types',
            '--validate=full',
            '--all-suites',
        ]
        if parsed.licenses:
            deploy_args += ["--licenses", parsed.licenses]
        if parsed.gpg:
            deploy_args += ["--gpg"]
        if parsed.gpg_keyid:
            deploy_args += ["--gpg-keyid", parsed.gpg_keyid]
        if parsed.repository_id:
            deploy_args += [parsed.repository_id]
            if parsed.url:
                deploy_args += [parsed.url]
        mx.maven_deploy(deploy_args)

    deploy_native_image_maven_plugin(svm_version, repo, parsed.gpg,
                                     parsed.gpg_keyid)

    success_message = [
        '',
        'Use the following plugin snippet to enable native-image building for your maven project:',
        '',
        '<plugin>',
        '    <groupId>com.oracle.substratevm</groupId>',
        '    <artifactId>native-image-maven-plugin</artifactId>',
        '    <version>' + svm_version + '</version>',
        '    <executions>',
        '        <execution>',
        '            <goals>',
        '                <goal>native-image</goal>',
        '            </goals>',
        '            <phase>package</phase>',
        '        </execution>',
        '    </executions>',
        '</plugin>',
        '',
    ]
    mx.log('\n'.join(success_message))