Closed gciatto closed 1 year ago
One may work around this issue by configuring the task as follows:
task<JavaExec>("runHelloWorld") {
group = "run"
classpath = sourceSets.getByName("main").runtimeClasspath
main = "jason.infra.centralised.RunCentralisedMAS"
standardInput = System.`in`
args(file("$projectDir/helloworld.mas2j").path)
}
i.e. by launching the RunCentralisedMAS
class directly.
However this is a workaround, and can only work with centralised MAS.
Hi @gciatto-unibo ,
what you are trying to do should work, otherwise, it is a bug and should be fixed.
We tried to remove the dependency of local configuration files recently.... I am not sure if it is available in Jason 2.5. Do you mind to try Jason 2.6.2? (it is available in the GitHub repository @cleberjamaral has mentioned in the other thread)
Note also that the dependency groups has changed:
implementation("org.jason", "jason", "2.6.2")
I confirm: the issue is still there with version 2.6.2
I didn’t realised you are using jason.runtime.RunJasonProject….
I repeated the issue here and will see how to fix it.
On 13 Apr 2021, at 12:03, Giovanni Ciatto @.***> wrote:
I confirm: the issue is still there with version 2.6.2
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
I hope I have fixed it. Could you try with Jason-2.6.3-SNAPSHOT? (available in the GitHub repo)
It makes sense to use RunCentralisedMAS in gradle.
RunJasonProject is used to create a script to execute the project (and then run it). Ant is used for this script. Once gradle is used in place of Ant, no need to write scripts.
RunCentralisedMas is not a good name for the class, it will be renamed to RunLocalMAS in the future. Since it runs some agentes (from .mas2j) in the a local machine (a JVM indeed). These local agents may belong to a distributed system.
On 13 Apr 2021, at 11:40, Giovanni Ciatto @.***> wrote:
One may work around this issue by configuring the task as follows:
task
("runHelloWorld" ) { group = "run" classpath
= sourceSets.getByName("main" ).runtimeClasspath main = "jason.infra.centralised.RunCentralisedMAS"
standardInput
= System.
in
args(file( "$projectDir/helloworld.mas2j" ).path) }i.e. by launching the RunCentralisedMAS class directly. However this is a workaround, and can only work with centralised MAS.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
I'd love to use Jason as a library in my Gradle-based projects. In particular I don't want to use Eclipse, nor Atom, nor sticking to any particular IDE. Plus, I'd like to avoid my projects to contain any
.jar
file.I know that Jason
.jar
s are available via the following Maven repository: http://jacamo.sourceforge.net/maven2/ So a simple solution coult be to setup my Jason project as follows (I use Kotlin as the build script language):Now suppose my project's structure is as follows:
I now may want to launch the system via a Gradle task, which I may set up as follows in
build.gradle.kts
:Given the output of
./gradlew dependencies
, I expect that dependenciesant
andant-launcher
are in-classpath when launching Jason via the aforementioned task:However, if I launch the task without having never configured Jason via the
jason.util.ConfigGUI
, I get the following message:before the program terminates. This is astonishing, as the
ant
-related.jar
s are in-classpath.Now my point is that I don't want developers participating to my project to be constrained to manually configure Jason before they can run a self-configuring Gradle script. Plus, Jason's configuration is stored into a
user.properties
file hidden within the user's home directory. This breaks the self-containedness of my Gradle-projects.I argue that it would be far better if
jason.runtime.RunJasonProject
could detect thatant
is in-classpath and start the MAS even if no configuration has been previously performed---i.e. if theuser.properties
file is missing.