如何在 gradle 中将 -np 参数传递给 MPJ?

How to pass -np argument to MPJ in gradle?

我正在尝试用 MPJ Express 做点什么(我的家庭作业) 我找不到如何将 -np 参数传递给 MPJRun。

group 'ST1'
version '1.0-SNAPSHOT'

apply plugin:  'application'

mainClassName = 'example.Main'
sourceCompatibility = 1.8
def mpjHome = System.getenv( 'MPJ_HOME')
def mpjStarter =  files("$mpjHome/lib/starter.jar")
def mpjJar = files("$mpjHome/lib/mpj.jar ")
def mpjClasspath = sourceSets.main.runtimeClasspath - mpjJar

dependencies {
    compile mpjJar
}

run{
    main = 'runtime.starter.MPJRun'
    classpath = mpjStarter
    args  '-np 2' ,mainClassName, '-cp' , mpjClasspath.asPath
    dependsOn classes
}

您的 args 行应该如下所示: args '-np', 2 ,mainClassName, '-cp' , mpjClasspath.asPath

在 gradle 中显示配置的电影:https://www.youtube.com/watch?v=gj-3Td6ZOyc&t=942s