Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.9</version>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>org.apache.directory.studio</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/entityc/compiler/EntityCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

public class EntityCompiler {

public static final String COMPILER_VERSION = "0.13.0";
public static final String COMPILER_VERSION = "0.13.1";
public static final String LANGUAGE_VERSION = "0.12.3";
private static final Map<String, String> defineValues = new HashMap<>();
private static final Set<String> templateSearchPath = new HashSet<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ public void run(String[] args) {
EntityCompiler.RunConfiguration(configuration);
ProjectManager.getInstance().endActiveConfiguration();

// If the configuration include a protoc block
EntityCompiler.RunProtoc(root, configuration);

// close out our session
ProjectManager.getInstance().close();
if (!quietMode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ public void run(String[] args) {
}
for (String schemaDirectory : directories) {
SSSchemaVersioning.setBasePath(schemaDirectory);
int readVersion = LoadSchemaVersion(SSSchemaVersioning.SchemaPointer.Read);
Integer readVersion = LoadSchemaVersion(SSSchemaVersioning.SchemaPointer.Read);
ECLog.log("");
ECLog.log("Schema Directory: " + schemaDirectory);
ECLog.log(" Previous version: " + ((readVersion > 1) ?
readVersion :
ECLog.log(" Previous version: " + ((readVersion > 0) ?
("" + readVersion) :
"(none)"));
ECLog.log(" Current version: " + LoadSchemaVersion(SSSchemaVersioning.SchemaPointer.Write));
ECLog.log(" Version advance directive: " + (SSSchemaVersioning.LoadAdvanceRequest() ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public RepositoryFile importFromRepository(MTRepository repository, MTRepository
try {
FileInputStream fis = new FileInputStream(inputFilepath);

ECLog.logInfo("Copying file " + inputFilepath + " to " + outputFilepath);
// ECLog.logInfo("Copying file " + inputFilepath + " to " + outputFilepath);
File outputFile = new File(outputFilepath);
FileOutputStream fos = new FileOutputStream(outputFile);
IOUtils.copy(fis, fos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.entityc.compiler.structure.sql;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import org.entityc.compiler.EntityCompiler;
Expand All @@ -31,7 +32,9 @@ public static void SaveSchemaVersion(SchemaPointer pointer, Integer version) {
"readVersion" :
"writeVersion";
String filepath = basePath + File.separator + pointerFilename + ".json";
Gson gson = new Gson();
Gson gson = new GsonBuilder()
.excludeFieldsWithoutExposeAnnotation()
.create();
try {
ensureBasePathDirectoryExists();
FileOutputStream fos = new FileOutputStream(filepath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package org.entityc.compiler.structure.sql;

import com.google.gson.annotations.Expose;
import org.entityc.compiler.EntityCompiler;
import org.entityc.compiler.util.ECLog;

import java.io.Serializable;
Expand All @@ -32,6 +31,7 @@ public class SSSourceFile extends SSNode implements Serializable {
@Expose
private final List<SSTable> tablesInOrder = new ArrayList<>();

@Expose
private final Map<String, SSIndex> indexesByName = new HashMap<>();

@Expose
Expand All @@ -50,13 +50,9 @@ public List<SSTable> getTablesInOrder() {
}

public void addTable(SSTable table) {
if (table.getName().endsWith("_many")) {
if (EntityCompiler.isVerbose()) {
ECLog.logInfo("ADDING TABLE: " + table.getName());
}
if (tablesByName.containsKey(table.getName())) {
//ECLog.logFatal("HEY! You can't add the same table multiple times!");
}
if (tablesByName.containsKey(table.getName())) {
ECLog.logWarning("Tried to add table multiple times: " + table.getName());
return;
}
tablesByName.put(table.getName(), table);
tablesByEntityName.put(table.getEntityName(), table);
Expand Down Expand Up @@ -107,6 +103,7 @@ public Collection<SSIndex> getIndexes() {
public Collection<SSSequence> getSequences() {
return sequences;
}

public String getFilename() {
return getName() + "." + getExtension();
}
Expand Down Expand Up @@ -207,7 +204,6 @@ public void processDependencyIssues() {
}
}
for (SSAlteredTable alteredTable : newAlteredTables) {
this.addTable(alteredTable);
tablesInOrder.add(alteredTable);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class SSTable extends SSNode {
private SSComment comment;

public SSTable(String tableName, String entityName) {
this.name = tableName;
this.name = tableName;
this.entityName = entityName;
}

Expand Down