<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    
    <parent>
        <groupId>com.codenameone</groupId>
        <artifactId>codenameone</artifactId>
        <version>7.0.227</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.codenameone</groupId>
    <artifactId>codenameone-designer</artifactId>
    <version>7.0.227</version>
    <packaging>jar</packaging>
    <name>codenameone-designer</name>
    <dependencies>
        <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant</artifactId>
        </dependency>
        
        <dependency>
            <groupId>com.codenameone</groupId>
            <artifactId>codenameone-core</artifactId>

        </dependency>
        <dependency>
            <groupId>com.codenameone</groupId>
            <artifactId>codenameone-javase-svg</artifactId>

        </dependency>
        <!-- https://mvnrepository.com/artifact/org.swinglabs/swing-layout -->
        <dependency>
            <groupId>org.swinglabs</groupId>
            <artifactId>swing-layout</artifactId>
            <version>1.0.3</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.swinglabs/swingx -->
        <dependency>
            <groupId>org.swinglabs</groupId>
            <artifactId>swingx</artifactId>
            <version>1.6.1</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.swinglabs.swingx/swingx-core -->
        <dependency>
            <groupId>org.swinglabs.swingx</groupId>
            <artifactId>swingx-core</artifactId>
            <version>1.6.5-1</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.jdesktop/appframework -->
        <dependency>
            <groupId>org.jdesktop</groupId>
            <artifactId>appframework</artifactId>
            <version>1.0.3</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.swinglabs.swingx/swingx-beaninfo -->
        <dependency>
            <groupId>org.swinglabs.swingx</groupId>
            <artifactId>swingx-beaninfo</artifactId>
            <version>1.6.5-1</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.swinglabs/swing-worker -->
        <dependency>
            <groupId>org.swinglabs</groupId>
            <artifactId>swing-worker</artifactId>
            <version>1.1</version>
        </dependency>
        
        <!-- https://mvnrepository.com/artifact/com.vaadin.external.flute/flute -->
        <dependency>
            <groupId>com.vaadin.external.flute</groupId>
            <artifactId>flute</artifactId>
            <version>1.3.0.gg2</version>
        </dependency>
        
        <!-- https://mvnrepository.com/artifact/org.w3c.css/sac -->
        <dependency>
            <groupId>org.w3c.css</groupId>
            <artifactId>sac</artifactId>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
        
        
        
    </dependencies>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>6</maven.compiler.source>
        <maven.compiler.target>6</maven.compiler.target>
        <src.dir>../../CodenameOneDesigner/src</src.dir>
    </properties>
    <build>
        <sourceDirectory>${src.dir}</sourceDirectory>
        <resources>
            <resource>
                <directory>${src.dir}</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>3.3.0</version>
                    <executions>
                        <execution>
                            <id>build-executable-jar</id>
                            <phase>package</phase>
                            <goals>
                                <goal>single</goal>
                            </goals>
                            <configuration>
                                <attach>false</attach>
                                <archive>
                                <manifest>
                                    <mainClass>
                                        com.codename1.designer.ResourceEditorApp
                                    </mainClass>
                                </manifest>
                                </archive>
                                <descriptorRefs>
                                    <descriptorRef>jar-with-dependencies</descriptorRef>
                                </descriptorRefs>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>

                        <executions>
                          <execution>
                              <id>add-designer-jar-with-dependencies</id>
                            <phase>package</phase>
                            <configuration>
                              <target>
                                  <delete dir="${project.build.directory}/${project.build.finalName}-jar-with-dependencies"/>
                                  <mkdir dir="${project.build.directory}/${project.build.finalName}-jar-with-dependencies"/>
                                  <move file="${project.build.directory}/${project.build.finalName}-jar-with-dependencies.jar"
                                      tofile="${project.build.directory}/${project.build.finalName}-jar-with-dependencies/designer_1.jar"/>
                                      <zip destfile="${project.build.directory}/${project.build.finalName}-jar-with-dependencies.jar" basedir="${project.build.directory}/${project.build.finalName}-jar-with-dependencies"/>
                                          
                                          

                              </target>
                            </configuration>
                            <goals>
                              <goal>run</goal>
                            </goals>
                          </execution>
                        </executions>
                      </plugin>
                      <plugin>
                              <groupId>org.codehaus.mojo</groupId>
                              <artifactId>build-helper-maven-plugin</artifactId>

                              <executions>
                                <execution>
                                  <id>attach-jar-with-dependencies</id>
                                  <phase>package</phase>
                                  <goals>
                                    <goal>attach-artifact</goal>
                                  </goals>
                                  <configuration>
                                    <artifacts>
                                      <artifact>
                                        <file>${project.build.directory}/${project.build.finalName}-jar-with-dependencies.jar</file>
                                        <type>jar</type>
                                        <classifier>jar-with-dependencies</classifier>
                                      </artifact>
                                      
                                    </artifacts>
                                  </configuration>
                                </execution>
                              </executions>
                            </plugin>
                  </plugins>
            </build>

    
</project>
