- ./
- bin/
- package/
- class.class
- dist/
- lib/
- library.jar
- lib/
- lib/
- library.jar
- src/
- package/
- class.java
- package/
- .classpath
- .project
- makefile
- manifest
- README.md
Last active
February 23, 2022 23:19
-
-
Save MikenTNT/8855df650f43b3582a6ed0517cf63bab to your computer and use it in GitHub Desktop.
Java project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<classpath> | |
<classpathentry kind="src" path="src"/> | |
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | |
<classpathentry kind="lib" path="dist/lib/nombre.jar"/> | |
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<projectDescription> | |
<name>test</name> | |
<comment></comment> | |
<projects> | |
</projects> | |
<buildSpec> | |
</buildSpec> | |
<natures> | |
<nature>org.eclipse.jdt.core.javanature</nature> | |
</natures> | |
<filteredResources> | |
<filter> | |
<id>1603828329903</id> | |
<name></name> | |
<type>30</type> | |
<matcher> | |
<id>org.eclipse.core.resources.regexFilterMatcher</id> | |
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments> | |
</matcher> | |
</filter> | |
</filteredResources> | |
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MAKEFILE DE PROYECTO JAVA, rev 10.3 | |
# Autor: MikenTNT 13-OCT-2019. | |
SHELL = /bin/bash | |
#-----------------------------------AJUSTES------------------------------------- | |
# NJAR: nombre del archivo .jar. | |
NJAR = $(shell grep "name" .project | cut -d "<" -f2 | cut -c 6-).jar | |
# LIBS: rutas de las bibiotecas. | |
LIBS = $(shell find lib -name "*.jar" | tr '\n' ':') | |
# CLASSPATH: rutas de las blibliotecas para compilar. | |
CLASSPATH = 'src:$(LIBS)' | |
#----------------------------------VARIABLES------------------------------------ | |
# SOURDIR: directorio de los paquetes y archivos fuentes de java. | |
SOURDIR = src | |
# CLASDIR: directorio de los paquetes y archivos compilados a class. | |
CLASDIR = bin | |
# Directorio de los archivos de programa. | |
RELDIR = dist | |
# SOURCES: rutas de los archivos fuente de java. | |
SOURCES := $(shell find $(SOURDIR) -regex ".*\.java") | |
# CLASSES: rutas de los archivos compilados a class. | |
CLASSES := $(patsubst $(SOURDIR)/%.java,$(CLASDIR)/%.class,$(SOURCES)) | |
# JVCO: opciones del comando javac para compilar archivos java. | |
JVCO = -encoding UTF-8 -d $(CLASDIR) -cp $(CLASSPATH) | |
# JAR: nombre y ruta del archivo comprimido a jar. | |
JAR := $(RELDIR)/$(NJAR) | |
# MF: archivo manifest, usar 'm' en vez de 'e' en comando jar. | |
MF = manifest | |
# Phony targets. | |
PHONY := all run clean init | |
#----------------------------OBJETIVOS PRINCIPALES------------------------------ | |
# Objetivos a ejecutar con el comando make. | |
all: $(JAR) | |
# Crear el archivo jar, y añade las bibliotecas y el archivo manifest. | |
$(JAR): $(CLASSES) $(MF) | |
jar cvmf $(MF) $(JAR) lib -C $(CLASDIR) . | |
# Compilacion de los archivos java a class. | |
$(CLASDIR)/%.class: $(SOURDIR)/%.java | |
javac $(JVCO) $< | |
#-------------------------------OTROS OBJETIVOS--------------------------------- | |
# Ejecutar el programa. | |
run: $(JAR) | |
@cd dist; java -jar $(NJAR) | |
# Objetivo para limpieza. | |
clean: | |
rm -rf $(CLASDIR)/* $(JAR) | |
#------------------------------------------------------------------------------- | |
.PHONY: $(PHONY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class-Path: . lib/ | |
Main-Class: main.Main | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment