Esempio n. 1
0
 def clean(self, forBuild=False):
     if forBuild:
         return
     mx.run_maven(['-q', 'clean'], nonZeroIsFatal=False, cwd=_suite.dir)
     jar = self.newestOutput()
     if jar.exists():
         os.remove(jar.path)
Esempio n. 2
0
 def clean(self, forBuild=False):
     if forBuild:
         return
     mx.run_maven(['-q', 'clean'], nonZeroIsFatal=False, cwd=_suite.dir)
     jar = self.newestOutput()
     if jar.exists():
         os.remove(jar.path)
Esempio n. 3
0
def maven_plugin_test(args):
    # Create native-image-maven-plugin-test pom with correct version info from template
    proj_dir = join(suite.dir, 'src', 'native-image-maven-plugin-test')
    svm_version = suite.release_version(snapshotSuffix='SNAPSHOT')
    pom_from_template(proj_dir, svm_version)
    # Build native image with native-image-maven-plugin
    mx.run_maven(['package'], cwd=proj_dir)
    mx.run([join(proj_dir, 'target', 'com.oracle.substratevm.nativeimagemojotest')])
Esempio n. 4
0
 def clean(self, forBuild=False):
     if forBuild:
         return
     maven_repo_arg, env = mavenSetup()
     quiet = [] if mx.get_opts().verbose else ['-q']
     mx.run_maven(quiet + [maven_repo_arg, 'clean'], nonZeroIsFatal=False, cwd=_suite.dir, env=env)
     jar = self.newestOutput()
     if jar.exists():
         os.remove(jar.path)
Esempio n. 5
0
def deploy_native_image_maven_plugin(svmVersion, action='install'):
    # Create native-image-maven-plugin pom with correct version info from template
    proj_dir = join(suite.dir, 'src', 'native-image-maven-plugin')
    dom = parse(join(proj_dir, 'pom_template.xml'))
    for svmVersionElement in dom.getElementsByTagName('svmVersion'):
        svmVersionElement.parentNode.replaceChild(dom.createTextNode(svmVersion), svmVersionElement)
    with open(join(proj_dir, 'pom.xml'), 'wb') as pom_file:
        dom.writexml(pom_file)
    # Build and install native-image-maven-plugin into local repository
    mx.run_maven([action], cwd=proj_dir)
Esempio n. 6
0
def deploy_native_image_maven_plugin(svmVersion, action='install'):
    # Create native-image-maven-plugin pom with correct version info from template
    proj_dir = join(suite.dir, 'src', 'native-image-maven-plugin')
    dom = parse(join(proj_dir, 'pom_template.xml'))
    for svmVersionElement in dom.getElementsByTagName('svmVersion'):
        svmVersionElement.parentNode.replaceChild(dom.createTextNode(svmVersion), svmVersionElement)
    with open(join(proj_dir, 'pom.xml'), 'wb') as pom_file:
        dom.writexml(pom_file)
    # Build and install native-image-maven-plugin into local repository
    mx.run_maven([action], cwd=proj_dir)
Esempio n. 7
0
 def build(self):
     cwd = _suite.dir
     maven_repo_arg, env = mavenSetup()
     mx.log("Building jruby-core with Maven")
     mx.run_maven(['-q', '-DskipTests', maven_repo_arg, '-pl', 'core,lib'], cwd=cwd, env=env)
     # Install Bundler
     gem_home = join(_suite.dir, 'lib', 'ruby', 'gems', 'shared')
     env['GEM_HOME'] = gem_home
     env['GEM_PATH'] = gem_home
     mx.run(['bin/jruby', 'bin/gem', 'install', 'bundler', '-v', '1.10.6'], cwd=cwd, env=env)
Esempio n. 8
0
 def clean(self, forBuild=False):
     if forBuild:
         return
     maven_args, env = mavenSetup()
     mx.run_maven(maven_args + ['clean'],
                  nonZeroIsFatal=False,
                  cwd=_suite.dir,
                  env=env)
     jar = self.newestOutput()
     if jar.exists():
         os.remove(jar.path)
Esempio n. 9
0
 def build(self):
     cwd = _suite.dir
     maven_repo_arg, env = mavenSetup()
     mx.log("Building jruby-core with Maven")
     quiet = [] if mx.get_opts().verbose else ['-q']
     mx.run_maven(quiet + ['-DskipTests', maven_repo_arg, '-Dcreate.sources.jar', '-pl', 'core,lib'], cwd=cwd, env=env)
     # Install Bundler
     gem_home = join(_suite.dir, 'lib', 'ruby', 'gems', 'shared')
     env['GEM_HOME'] = gem_home
     env['GEM_PATH'] = gem_home
     mx.run(['bin/jruby', 'bin/gem', 'install', 'bundler', '-v', '1.10.6'], cwd=cwd, env=env)
Esempio n. 10
0
 def build(self):
     cwd = _suite.dir
     maven_repo_arg, env = mavenSetup()
     mx.log("Building jruby-core with Maven")
     mx.run_maven(['-q', '-DskipTests', maven_repo_arg, '-pl', 'core,lib'],
                  cwd=cwd,
                  env=env)
     # Install Bundler
     gem_home = join(_suite.dir, 'lib', 'ruby', 'gems', 'shared')
     env['GEM_HOME'] = gem_home
     env['GEM_PATH'] = gem_home
     mx.run(['bin/jruby', 'bin/gem', 'install', 'bundler', '-v', '1.10.6'],
            cwd=cwd,
            env=env)
Esempio n. 11
0
def deploy_native_image_maven_plugin(svmVersion, repo, gpg, keyid):
    proj_dir = join(suite.dir, 'src', 'native-image-maven-plugin')
    pom_from_template(proj_dir, svmVersion)
    # Build and install native-image-maven-plugin into local repository

    maven_args = []
    if keyid:
        maven_args += ['-Dgpg.keyname=' + keyid]
    elif not gpg:
        maven_args += ['-Dgpg.skip=true']
    if repo == mx.maven_local_repository():
        maven_args += ['install']
    else:
        maven_args += [
            '-DaltDeploymentRepository={}::default::{}'.format(
                repo.name, repo.get_url(svmVersion)), 'deploy'
        ]
    mx.run_maven(maven_args, cwd=proj_dir)
Esempio n. 12
0
    def build(self):
        if not self.subject.build:
            mx.log("...skip build of {}".format(self.subject))
            return
        mx.log('...perform build of {}'.format(self.subject))

        rubyDir = _suite.dir
        mavenDir = os.path.join(rubyDir, 'mxbuild', 'mvn')

        # HACK: since the maven executable plugin does not configure the
        # java executable that is used we unfortunately need to append it to the PATH
        javaHome = os.getenv('JAVA_HOME')
        if javaHome:
            os.environ["PATH"] = os.environ[
                "JAVA_HOME"] + '/bin' + os.pathsep + os.environ["PATH"]

        mx.logv('Setting PATH to {}'.format(os.environ["PATH"]))
        mx.logv('Calling java -version')
        mx.run(['java', '-version'])

        # Truffle version

        truffle = mx.suite('truffle')
        truffle_commit = truffle.vc.parent(truffle.dir)
        maven_version_arg = '-Dtruffle.version=' + truffle_commit
        maven_repo_arg = '-Dmaven.repo.local=' + mavenDir

        mx.run_mx(['maven-install', '--repo', mavenDir], suite=truffle)

        open(os.path.join(rubyDir, 'VERSION'), 'w').write('graal-vm\n')

        # Build jruby-truffle

        mx.run_maven(['--version', maven_repo_arg],
                     nonZeroIsFatal=False,
                     cwd=rubyDir)

        mx.log('Building without tests')

        mx.run_maven(['-DskipTests', maven_version_arg, maven_repo_arg],
                     cwd=rubyDir)

        mx.log('Building complete version')

        mx.run_maven(
            ['-Pcomplete', '-DskipTests', maven_version_arg, maven_repo_arg],
            cwd=rubyDir)
        mx.run([
            'zip', '-d',
            'maven/jruby-complete/target/jruby-complete-graal-vm.jar',
            'META-INF/jruby.home/lib/*'
        ],
               cwd=rubyDir)
        mx.run(['bin/jruby', 'bin/gem', 'install', 'bundler', '-v', '1.10.6'],
               cwd=rubyDir)
        mx.log('...finished build of {}'.format(self.subject))
Esempio n. 13
0
    def build(self):
        if not self.subject.build:
            mx.log("...skip build of {}".format(self.subject))
            return
        mx.log('...perform build of {}'.format(self.subject))

        rubyDir = _suite.dir
        mavenDir = os.path.join(rubyDir, 'mxbuild', 'mvn')

        # HACK: since the maven executable plugin does not configure the
        # java executable that is used we unfortunately need to append it to the PATH
        javaHome = os.getenv('JAVA_HOME')
        if javaHome:
            os.environ["PATH"] = os.environ["JAVA_HOME"] + '/bin' + os.pathsep + os.environ["PATH"]

        mx.logv('Setting PATH to {}'.format(os.environ["PATH"]))
        mx.logv('Calling java -version')
        mx.run(['java', '-version'])

        # Truffle version

        truffle = mx.suite('truffle')
        truffle_commit = truffle.vc.parent(truffle.dir)
        maven_version_arg = '-Dtruffle.version=' + truffle_commit
        maven_repo_arg = '-Dmaven.repo.local=' + mavenDir
        
        mx.run_mx(['maven-install', '--repo', mavenDir, '--only', 'TRUFFLE_API,TRUFFLE_DEBUG,TRUFFLE_DSL_PROCESSOR,TRUFFLE_TCK'], suite=truffle)

        open(os.path.join(rubyDir, 'VERSION'), 'w').write('graal-vm\n')

        # Build jruby-truffle
        
        env = os.environ.copy()
        env['JRUBY_BUILD_MORE_QUIET'] = 'true'

        mx.run_maven(['-q', '--version', maven_repo_arg], nonZeroIsFatal=False, cwd=rubyDir, env=env)

        mx.log('Building without tests')

        mx.run_maven(['-q', '-DskipTests', maven_version_arg, maven_repo_arg], cwd=rubyDir, env=env)

        mx.log('Building complete version')

        mx.run_maven(['-q', '-Pcomplete', '-DskipTests', maven_version_arg, maven_repo_arg], cwd=rubyDir, env=env)
        mx.run(['zip', '-d', 'maven/jruby-complete/target/jruby-complete-graal-vm.jar', 'META-INF/jruby.home/lib/*'], cwd=rubyDir)
        mx.run(['bin/jruby', 'bin/gem', 'install', 'bundler', '-v', '1.10.6'], cwd=rubyDir)
    
        mx.log('...finished build of {}'.format(self.subject))
Esempio n. 14
0
    def build(self):
        if not self.subject.build:
            mx.log("...skip build of {}".format(self.subject))
            return
        mx.log('...perform build of {}'.format(self.subject))

        rubyDir = _suite.dir

        # HACK: since the maven executable plugin does not configure the
        # java executable that is used we unfortunately need to append it to the PATH
        javaHome = os.getenv('JAVA_HOME')
        if javaHome:
            os.environ["PATH"] = os.environ["JAVA_HOME"] + '/bin' + os.pathsep + os.environ["PATH"]

        mx.logv('Setting PATH to {}'.format(os.environ["PATH"]))
        mx.logv('Calling java -version')
        mx.run(['java', '-version'])

        # Truffle version

        truffle = mx.suite('truffle')
        truffle_commit = truffle.vc.parent(truffle.dir)

        mx.run_mx(['maven-install'], suite=truffle)

        open(join(rubyDir, 'VERSION'), 'w').write('graal-vm\n')

        # Build jruby-truffle and

        mx.run(['find', '.'], nonZeroIsFatal=False, cwd=rubyDir)
        mx.run_maven(['--version'], nonZeroIsFatal=False, cwd=rubyDir)

        mx.log('Building without tests')

        mx.run_maven(['-DskipTests', '-Dtruffle.version=' + truffle_commit], cwd=rubyDir)

        mx.log('Building complete version')

        mx.run_maven(['-Pcomplete', '-DskipTests', '-Dtruffle.version=' + truffle_commit], cwd=rubyDir)
        mx.run(['zip', '-d', 'maven/jruby-complete/target/jruby-complete-graal-vm.jar', 'META-INF/jruby.home/lib/*'], cwd=rubyDir)
        mx.run(['bin/jruby', 'bin/gem', 'install', 'bundler', '-v', '1.10.6'], cwd=rubyDir)
Esempio n. 15
0
 def clean(self, forBuild=False):
     if forBuild:
         return
     rubyDir = _suite.dir
     mx.run_maven(['clean'], nonZeroIsFatal=False, cwd=rubyDir)
Esempio n. 16
0
 def clean(self, forBuild=False):
     if forBuild:
         return
     rubyDir = _suite.dir
     mx.run_maven(['clean'], nonZeroIsFatal=False, cwd=rubyDir)