Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

WidgetsDebug task does not work with default configuration #21

Closed
Flaurite opened this issue Jul 23, 2021 · 1 comment
Closed

WidgetsDebug task does not work with default configuration #21

Flaurite opened this issue Jul 23, 2021 · 1 comment
Assignees
Labels
type: bug Something isn't working
Milestone

Comments

@Flaurite
Copy link
Contributor

Flaurite commented Jul 23, 2021

Description

Steps to reproduce

  1. Create new project;
  2. Add charts add-on. Studio will add the following dependencies:
implementation("io.jmix.ui:jmix-charts-starter")
widgets("io.jmix.ui:jmix-ui-widgets")
widgets("io.jmix.ui:jmix-charts-widgets")

3.1 Add import to the build.gradle:

import io.jmix.gradle.ui.WidgetsDebug

3.2 Add debugWidget task:

task debugWidgets(type: WidgetsDebug, dependsOn: classes) {
    widgetSetClass 'com.company.myapp.widgets.CustomWidgetSet'
    xmx '-Xmx1600m'
}
  1. Run the following command: ./gradlew debugWidgets

AR

Exception in thread "main" java.lang.RuntimeException: Unable to run Main-Class:com.google.gwt.dev.codeserver.CodeServer
        at io.jmix.gradle.ClassPathCommandLine.invokeOriginalMainClass(ClassPathCommandLine.java:56)
        at io.jmix.gradle.ClassPathCommandLine.main(ClassPathCommandLine.java:47)
Caused by: java.lang.ClassNotFoundException: com.google.gwt.dev.codeserver.CodeServer
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        at io.jmix.gradle.ClassPathCommandLine.invokeOriginalMainClass(ClassPathCommandLine.java:52)

This is because WidgetsDebug task does not take artifacts from widgets configuration. We can additionally add widgets:

implementation 'io.jmix.ui:jmix-ui-widgets';
implementation 'io.jmix.ui:jmix-charts-widgets';

But we still need ru.finam:slf4j-gwt artifact that is included only in widgets configuration.

QA

  1. Create a project
  2. In the build.gradle remove:
    implementation 'io.jmix.ui:jmix-ui-widgets-compiled'
    
    and add
    widgets 'io.jmix.ui:jmix-ui-widgets'
    

3.1 Add import to the build.gradle:

import io.jmix.gradle.ui.WidgetsDebug

3.2 In the build.gradle add the following tasks:

compileWidgets {
    dependsOn(processResources)
    generate "io.jmix.ui.widget.WidgetSet"
}

task debugWidgets(type: WidgetsDebug, dependsOn: classes) {
    widgetSetClass 'io.jmix.ui.widget.WidgetSet'
    xmx '-Xmx1600m'
}
  1. In the application.properties add: jmix.ui.widgetSet=io.jmix.ui.widget.WidgetSet
  2. Refresh gradle project and run the following command in the terminal: ./gradlew debugW

The code server should start.

@Flaurite Flaurite added the type: bug Something isn't working label Jul 23, 2021
@Flaurite Flaurite added this to the 1.1.0 milestone Jul 23, 2021
@Flaurite Flaurite self-assigned this Jul 23, 2021
Flaurite added a commit to jmix-projects/jmix-templates that referenced this issue Jul 30, 2021
@maistrenkoIulia
Copy link

verified

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants