build tools updates

This commit is contained in:
austin 2022-02-07 01:54:23 -05:00
parent 4faaf8d923
commit 26a999de28
9 changed files with 119 additions and 165 deletions

View File

@ -1,12 +1,20 @@
#DEPENDENCIES
#Windows, JDK17, Maven, GitBash, 7zip, MinGW, GCC, Make
#completely clear build directory
rm -rf ./build rm -rf ./build
#build directory structure
mkdir build mkdir build
mkdir ./build/assets mkdir ./build/assets
#compile project and copy into build dir
mvn package mvn package
cp ./target/Renderer-0.1.jar ./build/engine.jar cp ./target/Renderer-0.1.jar ./build/engine.jar
#build launcher
cd ./launcher/ cd ./launcher/
make clean make clean
make build make build
cd .. cd ..
cp ./launcher/launcher.exe ./build/ #copy launcher, jdk, and assets into build dir
mv ./launcher/launcher.exe ./build/
unzip ./launcher/jdk.zip -d ./build/ unzip ./launcher/jdk.zip -d ./build/
cp -r ./assets/* ./build/assets/ cp -r ./assets/* ./build/assets/

View File

@ -1,3 +1,9 @@
#TODO: make support multiple OSes
#detect os: (not that bad)
#https://stackoverflow.com/questions/714100/os-detecting-makefile
#mingw flags to not have console window
#https://stackoverflow.com/questions/4441551/how-to-stop-a-program-compiled-with-mingw-g-from-opening-a-console-window-in
build: ./src/main.c build: ./src/main.c
gcc ./src/main.c -o launcher gcc ./src/main.c -o launcher

Binary file not shown.

Binary file not shown.

View File

@ -2,13 +2,18 @@
#include<stdlib.h> #include<stdlib.h>
#include<string.h> #include<string.h>
#include<unistd.h> #include<unistd.h>
#include<fcntl.h>
#include<sys/types.h>
#include<sys/stat.h>
#define MAX_PATH_SIZE 250 #define MAX_PATH_SIZE 250
#define LOG_HOLDER_SIZE 500 #define LOG_HOLDER_SIZE 500
void logVar(char * message, char * var); void logVar(char * message, char * var);
void redirectStdout();
int main(){ int main(){
redirectStdout();
char currentWorkingDirectory[MAX_PATH_SIZE]; char currentWorkingDirectory[MAX_PATH_SIZE];
if(getcwd(currentWorkingDirectory,sizeof(currentWorkingDirectory)) != NULL){ if(getcwd(currentWorkingDirectory,sizeof(currentWorkingDirectory)) != NULL){
} else { } else {
@ -34,6 +39,17 @@ int main(){
return 0; return 0;
} }
void redirectStdout(){
int outfd = open("stdout.txt", O_CREAT|O_WRONLY|O_TRUNC, 0644);
if (!outfd)
{
printf("Error opening stdout redirect");
fflush(stdout);
}
dup2(outfd, 1); // replace stdout
close(outfd);
}
char logHolder[LOG_HOLDER_SIZE]; char logHolder[LOG_HOLDER_SIZE];
void logVar(char * message, char * var){ void logVar(char * message, char * var){

View File

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>run</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
</goals>
<properties>
<exec.args>-XstartOnFirstThread -classpath %classpath electrosphere.main.Main</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
<action>
<actionName>debug</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
</goals>
<properties>
<exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -XstartOnFirstThread -classpath %classpath electrosphere.main.Main</exec.args>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
</properties>
</action>
<action>
<actionName>profile</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
</goals>
<properties>
<exec.args>-XstartOnFirstThread -classpath %classpath electrosphere.main.Main</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
</actions>

View File

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>run</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath electrosphere.main.Main</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
<action>
<actionName>debug</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
</goals>
<properties>
<exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath electrosphere.main.Main</exec.args>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
</properties>
</action>
<action>
<actionName>profile</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath electrosphere.main.Main</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
</actions>

156
pom.xml
View File

@ -198,75 +198,91 @@
</includes> </includes>
</resource> </resource>
</resources> </resources>
<plugins> <pluginManagement>
<plugin> <plugins>
<artifactId>maven-assembly-plugin</artifactId> <plugin>
<configuration> <artifactId>maven-assembly-plugin</artifactId>
<archive> <configuration>
<manifest> <archive>
<addClasspath>true</addClasspath> <manifest>
<mainClass>electrosphere.main.Main</mainClass> <addClasspath>true</addClasspath>
</manifest> <mainClass>electrosphere.main.Main</mainClass>
</archive> </manifest>
<descriptorRefs> </archive>
<descriptorRef>jar-with-dependencies</descriptorRef> <descriptorRefs>
</descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef>
</configuration> </descriptorRefs>
<executions> </configuration>
<execution> <executions>
<id>assemble-all</id> <execution>
<phase>package</phase> <id>assemble-all</id>
<goals> <phase>package</phase>
<goal>single</goal> <goals>
</goals> <goal>single</goal>
</execution> </goals>
</executions> </execution>
</plugin> </executions>
<plugin> </plugin>
<groupId>org.apache.maven.plugins</groupId> <plugin>
<artifactId>maven-shade-plugin</artifactId> <groupId>org.apache.maven.plugins</groupId>
<version>3.2.4</version> <artifactId>maven-shade-plugin</artifactId>
<executions> <version>3.2.4</version>
<execution> <executions>
<phase>package</phase> <execution>
<goals> <phase>package</phase>
<goal>shade</goal> <goals>
</goals> <goal>shade</goal>
<configuration> </goals>
<transformers> <configuration>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <transformers>
<mainClass>electrosphere.main.Main</mainClass> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
</transformer> <mainClass>electrosphere.main.Main</mainClass>
</transformers> </transformer>
</configuration> </transformers>
</execution> </configuration>
</executions> </execution>
</plugin> </executions>
<plugin> </plugin>
<groupId>org.codehaus.mojo</groupId> <plugin>
<artifactId>exec-maven-plugin</artifactId> <groupId>org.codehaus.mojo</groupId>
<version>3.0.0</version> <artifactId>exec-maven-plugin</artifactId>
<executions> <version>3.0.0</version>
<execution> <executions>
<goals> <execution>
<goal>exec</goal> <goals>
</goals> <goal>exec</goal>
</execution> </goals>
</executions> <configuration>
<configuration> <executable>java</executable>
<executable>java</executable> <includeProjectDependencies>false</includeProjectDependencies>
<includeProjectDependencies>false</includeProjectDependencies> <includePluginDependencies>true</includePluginDependencies>
<includePluginDependencies>true</includePluginDependencies> <mainClass>electrosphere.main.Main</mainClass>
<mainClass>electrosphere.main.Main</mainClass> <!-- <classpathScope>compile</classpathScope> -->
<!-- <classpathScope>compile</classpathScope> --> <arguments>
<arguments> <argument>-cp</argument>
<argument>-cp</argument> <argument>target/classes;target/Renderer-0.1-jar-with-dependencies.jar</argument>
<argument>target/classes;target/Renderer-0.1-jar-with-dependencies.jar</argument> <argument>electrosphere.main.Main</argument>
<argument>electrosphere.main.Main</argument> </arguments>
</arguments> <!-- <classesDirectory>${project.basedir}/target/classes</classesDirectory> -->
<!-- <classesDirectory>${project.basedir}/target/classes</classesDirectory> --> </configuration>
</configuration> </execution>
</plugin> <execution>
</plugins> <id>Telephone</id>
<phase>generate-sources</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<executable>java</executable>
<arguments>
<argument>-jar</argument>
<argument>Telephone-0.2.1.jar</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build> </build>
</project> </project>

View File

@ -312,8 +312,8 @@ public class Globals {
public static boolean RENDER_FLAG_RENDER_SHADOW_MAP = false; public static boolean RENDER_FLAG_RENDER_SHADOW_MAP = false;
public static boolean RENDER_FLAG_RENDER_SCREEN_FRAMEBUFFER_CONTENT = false; public static boolean RENDER_FLAG_RENDER_SCREEN_FRAMEBUFFER_CONTENT = false;
public static boolean RENDER_FLAG_RENDER_SCREEN_FRAMEBUFFER = false; public static boolean RENDER_FLAG_RENDER_SCREEN_FRAMEBUFFER = false;
public static boolean RENDER_FLAG_RENDER_BLACK_BACKGROUND = false; public static boolean RENDER_FLAG_RENDER_BLACK_BACKGROUND = true;
public static boolean RENDER_FLAG_RENDER_WHITE_BACKGROUND = true; public static boolean RENDER_FLAG_RENDER_WHITE_BACKGROUND = false;
public static boolean RENDER_FLAG_RENDER_UI = true; public static boolean RENDER_FLAG_RENDER_UI = true;