Skip to content

Commit 97c2059

Browse files
authored
Merge pull request #137 from pwgit-create/develop
Develop
2 parents 57af7a7 + 911b2eb commit 97c2059

18 files changed

Lines changed: 332 additions & 277 deletions

File tree

AppWish/AppWish/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
<properties>
2929
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
30-
<junit.version>5.9.3</junit.version>
30+
<junit.version>5.11.0-M2</junit.version>
3131
<javafx.version>19.0.2.1</javafx.version>
3232
<sonar.organization>pn-dev</sonar.organization>
3333
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
@@ -77,7 +77,7 @@
7777
<plugin>
7878
<groupId>org.apache.maven.plugins</groupId>
7979
<artifactId>maven-compiler-plugin</artifactId>
80-
<version>3.10.1</version>
80+
<version>3.13.0</version>
8181
<configuration>
8282
<source>19</source>
8383
<target>19</target>
@@ -108,7 +108,7 @@
108108
<plugin>
109109
<groupId>org.apache.maven.plugins</groupId>
110110
<artifactId>maven-shade-plugin</artifactId>
111-
<version>3.0.0</version>
111+
<version>3.6.0</version>
112112
<executions>
113113
<execution>
114114
<phase>package</phase>
Binary file not shown.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
3+
import javax.swing.*;
4+
import java.awt.*;
5+
import java.util.List;
6+
import java.util.ArrayList;
7+
8+
public class MountainGUI {
9+
10+
public static void main(String[] args) {
11+
JFrame frame = new JFrame("3 Biggest Mountains in the World");
12+
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
13+
14+
JPanel panel = new JPanel();
15+
panel.setLayout(new GridLayout(0, 2));
16+
17+
List<String> mountains = new ArrayList<>();
18+
mountains.add("Mount Everest (Nepal/China)");
19+
mountains.add("K2 (Pakistan/China)");
20+
mountains.add("Kangchenjunga (India/Nepal)");
21+
22+
for (int i = 0; i < mountains.size(); i++) {
23+
JLabel mountainLabel = new JLabel(mountains.get(i));
24+
panel.add(new JLabel("Rank: " + (i + 1)));
25+
panel.add(mountainLabel);
26+
panel.add(new JSeparator());
27+
}
28+
29+
frame.getContentPane().add(panel);
30+
31+
frame.pack();
32+
frame.setVisible(true);
33+
}
34+
}
35+
Binary file not shown.

AppWish/AppWish/src/main/resources/java_source_code_classes_tmp/OceanGUI.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
23
import javax.swing.*;
34
import java.awt.*;
45
import java.awt.event.*;
@@ -12,22 +13,24 @@ public static void main(String[] args) {
1213

1314
// Create a panel to hold the labels and text
1415
JPanel panel = new JPanel();
15-
panel.setLayout(new GridLayout(3, 1));
16+
panel.setLayout(new GridLayout(4, 1));
1617

1718
// Add labels and text for each ocean
1819
JLabel pacificLabel = new JLabel("Pacific Ocean: " + 155.6e+6 + " km²");
1920
JLabel atlanticLabel = new JLabel("Atlantic Ocean: " + 85.1e+6 + " km²");
2021
JLabel indianLabel = new JLabel("Indian Ocean: " + 73.5e+6 + " km²");
22+
JLabel arcticLabel = new JLabel("Arctic Ocean: " + 14.0e+6 + " km²");
2123

2224
panel.add(pacificLabel);
2325
panel.add(atlanticLabel);
2426
panel.add(indianLabel);
27+
panel.add(arcticLabel);
2528

2629
// Add the panel to the frame
2730
frame.getContentPane().add(panel);
2831

2932
// Set the size and show the frame
30-
frame.setSize(300, 150);
33+
frame.setSize(300, 200);
3134
frame.setVisible(true);
3235
}
3336
}

cg/CodeGenerator/CodeGenerator/dependency-reduced-pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>pn.dev</groupId>
55
<artifactId>code-generator-ollama</artifactId>
6-
<version>1.7.1</version>
6+
<version>1.7.2</version>
77
<description>The Java Application-Generator (pn.dev.code-generator-ollama) creates applications by giving a string of your desired features for a Java application, like this: AppSystem.StartCodeGenerator(String appWish)</description>
88
<inceptionYear>2024</inceptionYear>
99
<developers>
@@ -22,26 +22,26 @@
2222
<plugins>
2323
<plugin>
2424
<artifactId>maven-compiler-plugin</artifactId>
25-
<version>3.11.0</version>
25+
<version>3.13.0</version>
2626
<configuration>
2727
<source>19</source>
2828
<target>19</target>
2929
</configuration>
3030
</plugin>
3131
<plugin>
3232
<artifactId>maven-surefire-plugin</artifactId>
33-
<version>3.0.0</version>
33+
<version>3.1.2</version>
3434
<dependencies>
3535
<dependency>
3636
<groupId>org.junit.jupiter</groupId>
3737
<artifactId>junit-jupiter-engine</artifactId>
38-
<version>5.9.3</version>
38+
<version>5.11.0-M2</version>
3939
</dependency>
4040
</dependencies>
4141
</plugin>
4242
<plugin>
4343
<artifactId>maven-shade-plugin</artifactId>
44-
<version>3.4.1</version>
44+
<version>3.6.0</version>
4545
<executions>
4646
<execution>
4747
<phase>package</phase>
@@ -66,7 +66,7 @@
6666
<dependency>
6767
<groupId>org.junit.jupiter</groupId>
6868
<artifactId>junit-jupiter-api</artifactId>
69-
<version>5.9.3</version>
69+
<version>5.11.0-M2</version>
7070
<scope>test</scope>
7171
<exclusions>
7272
<exclusion>
@@ -86,7 +86,7 @@
8686
<dependency>
8787
<groupId>org.apache.maven.plugins</groupId>
8888
<artifactId>maven-surefire-plugin</artifactId>
89-
<version>3.0.0</version>
89+
<version>3.1.2</version>
9090
<scope>test</scope>
9191
<exclusions>
9292
<exclusion>

cg/CodeGenerator/CodeGenerator/pom.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,40 +49,40 @@
4949
<dependency>
5050
<groupId>io.github.amithkoujalgi</groupId>
5151
<artifactId>ollama4j</artifactId>
52-
<version>1.0.44</version>
52+
<version>1.0.72</version>
5353
</dependency>
5454
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
5555
<dependency>
5656
<groupId>org.junit.jupiter</groupId>
5757
<artifactId>junit-jupiter-api</artifactId>
58-
<version>5.9.3</version>
58+
<version>5.11.0-M2</version>
5959
<scope>test</scope>
6060
</dependency>
6161
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
6262
<dependency>
6363
<groupId>org.slf4j</groupId>
6464
<artifactId>slf4j-simple</artifactId>
65-
<version>2.0.7</version>
65+
<version>2.0.13</version>
6666
</dependency>
6767
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
6868
<dependency>
6969
<groupId>org.slf4j</groupId>
7070
<artifactId>slf4j-api</artifactId>
71-
<version>2.0.7</version>
71+
<version>2.0.13</version>
7272
</dependency>
7373
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin -->
74-
<dependency>
75-
<groupId>org.apache.maven.plugins</groupId>
76-
<artifactId>maven-surefire-plugin</artifactId>
77-
<scope>test</scope>
78-
<version>3.0.0</version>
79-
</dependency>
74+
<dependency>
75+
<groupId>org.apache.maven.plugins</groupId>
76+
<artifactId>maven-surefire-plugin</artifactId>
77+
<scope>test</scope>
78+
<version>3.1.2</version>
79+
</dependency>
8080
</dependencies>
8181
<build>
8282
<plugins>
8383
<plugin>
8484
<groupId>org.apache.maven.plugins</groupId>
85-
<version>3.11.0</version>
85+
<version>3.13.0</version>
8686
<artifactId>maven-compiler-plugin</artifactId>
8787
<configuration>
8888
<source>19</source>
@@ -92,19 +92,19 @@
9292
<plugin>
9393
<groupId>org.apache.maven.plugins</groupId>
9494
<artifactId>maven-surefire-plugin</artifactId>
95-
<version>3.0.0</version>
95+
<version>3.1.2</version>
9696
<dependencies>
9797
<dependency>
9898
<groupId>org.junit.jupiter</groupId>
9999
<artifactId>junit-jupiter-engine</artifactId>
100-
<version>5.9.3</version>
100+
<version>5.11.0-M2</version>
101101
</dependency>
102102
</dependencies>
103103
</plugin>
104104
<plugin>
105105
<groupId>org.apache.maven.plugins</groupId>
106106
<artifactId>maven-shade-plugin</artifactId>
107-
<version>3.4.1</version>
107+
<version>3.6.0</version>
108108
<executions>
109109
<execution>
110110
<phase>package</phase>

cg/CodeGenerator/CodeGenerator/src/main/java/pn/cg/app_system/AppSystem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ private static void StartCodeGenerator(String appWish, boolean isFirstRun, boole
5757
Thread.currentThread().interrupt();
5858
}
5959
retryCounter++;
60-
log.debug("In CheckCompilationRetryCounter with counter -> " + retryCounter);
60+
log.debug("In CheckCompilationRetryCounter with counter -> {}", retryCounter);
6161

6262
if(isCreateAppGeneration)
6363
appWishCompileResult = ollamaRemoteSystem.CreateApp(appWish, false,"",null);

cg/CodeGenerator/CodeGenerator/src/main/java/pn/cg/app_system/code_generation/ClassCompiler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ public ClassCompiler() {
2222
/**
2323
* Tries to compile a file with java source code into byte code
2424
*
25-
* @param className
25+
* @param className Class name of the class that we will try to compile
2626
*/
2727
public void compileClass(String className) {
2828

2929

3030
ExecutorService executor = ThreadPoolMaster.getInstance().getExecutor();
3131

32-
log.debug("Compiler path -> " + TaskUtil.addFilePathToClassName(className + CommonStringConstants.JAVA_FILE_EXTENSION));
32+
log.debug("Compiler path -> {}", TaskUtil.addFilePathToClassName(className + CommonStringConstants.JAVA_FILE_EXTENSION));
3333

3434
String scriptToUse = ScriptConstants.JAVAC_SCRIPT_NAME;
35-
log.debug("script used when compiling -> " + scriptToUse);
35+
log.debug("script used when compiling -> {}", scriptToUse);
3636

3737
executor.execute(new CompileClassTask(scriptToUse, new String[]{TaskUtil.addFilePathToClassName(className + CommonStringConstants.JAVA_FILE_EXTENSION)}));
3838

cg/CodeGenerator/CodeGenerator/src/main/java/pn/cg/app_wish/QuestionBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ public String createFeatureQuestion() {
2525
/**
2626
* Creates a questions for ollama model that should produce java code of a class (in a feature)
2727
*
28-
* @param classForFeature
28+
* @param classForFeature A class that is needed as a member in bigger feature / project
2929
* @return String
30-
* @Respone-goal A single java class that is needed part for the feature
30+
* @Response-goal A single java class that is needed part for the feature
3131
*/
3232
public String createClassQuestion(final String classForFeature) {
3333
return QuestionConstants.APP_WISH_PREFIX_CLASS + classForFeature;
@@ -36,7 +36,7 @@ public String createClassQuestion(final String classForFeature) {
3636
/**
3737
* Creates a question for ollama model that should produce a correct implementation of class that did not compile
3838
*
39-
* @param compileErrorMessage
39+
* @param compileErrorMessage The compile error text
4040
* @return String
4141
* @Response-goal A class implementation that will compile successfully
4242
*/

0 commit comments

Comments
 (0)