khalilou88 / jnxplus

Nx plugins that adds Java/Kotlin monorepo support to Nx workspace using Gradle and Maven
MIT License
65 stars 16 forks source link

Project crystal #882

Open khalilou88 opened 8 months ago

khalilou88 commented 8 months ago

I think of adding targets to plugin option so if build and test not present in the project.json or the project.json is not present. This will be added automatically:

{
  "targets": [
    {
      "defaultName": "build",
      "customName": "build-maven",
      "defaultTask": "install"
    },
    {
      "defaultName": "test",
      "customName": "test-maven",
      "defaultTask": "test"
    },
    {
      "defaultName": "ktlint",
      "defaultTask": "antrun:run@ktlint"
    }
  ]
}

the customName will be optional.

we should use task from Nx default targets first and if not present we use defaultTask from plugin options.

jbadeau commented 7 months ago

Im curious how crystal can help with the maven integration. On another note, we could contribute migrators as we currently maintain them ourselves but would be good to put them where they belong?

khalilou88 commented 6 months ago

New design:

{
  "mavenRootDirectory": "nx-maven",
  "localRepoRelativePath: ".m2/repository",
  "buildTargetName": "build-maven",
  "testTargetName": "test-maven",
  "targets": [
    {
      "target": "build-maven",
      "defaultTask": "install"
    },
    {
      "target": "test-maven",
      "defaultTask": "test"
    },
    {
      "target": "ktlint",
      "defaultTask": "antrun:run@ktlint"
    }
  ]
}
jbadeau commented 6 months ago

I like the *TargetName options.

would make targets optional and change defaultTask to task

khalilou88 commented 6 months ago

I already added buildTargetName to the plugin options: https://github.com/khalilou88/jnxplus/commit/628c80f1f1652e1f7478b3dae37cf8a0a9ce9789

khalilou88 commented 6 months ago

I believe we need more than one task:

    {
      "target": "build-maven",
      "appTask": "compile -DskipTests=true",
      "libTask": "install -DskipTests=true",
      "defaultTask": "install"
    },
jbadeau commented 6 months ago
{
  "mavenRootDirectory": ".",
  "localRepoRelativePath: ".m2/repository",
  "lintTargetName": "maven-lint",
  "formatTargetName": "maven-format",
  "testTargetName": "maven-test",
  "buildTargetName": "maven-build",
  "releaseTargetName": "maven-release",
  "e2eTargetName": "maven-e2e"
  "targets": [
    {
      "target": "testTargetName",
      "task": "test"
    },
    {
      "target": "buildTargetName",
      "task": "clean install -DskipTests=true"
    },
    {
      "target": "releaseTargetName",
      "task": "deploy -DskipTests=true"
    }
    ...
  ]
}

An issue here is that there is allot of rebuilding going on. Would be nice to have something like