-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad71146
commit 81dc1d7
Showing
6 changed files
with
260 additions
and
193 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
otc-compiler/src/main/java/org/otcframework/compiler/AbstractCompiler.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.otcframework.compiler; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import org.otcframework.common.config.OtcConfig; | ||
import org.otcframework.common.dto.RegistryDto; | ||
import org.otcframework.common.util.OtcUtils; | ||
import org.otcframework.compiler.exception.OtcCompilerException; | ||
|
||
import java.io.FileOutputStream; | ||
import java.io.IOException; | ||
|
||
abstract class AbstractCompiler { | ||
|
||
protected static final String OTC_TMD_LOCATION = OtcConfig.getOtcTmdDirectoryPath(); | ||
|
||
protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); | ||
|
||
/** | ||
* Creates the registration file. | ||
* | ||
* @param registryDto the registry dto | ||
*/ | ||
protected void createRegistrationFile(RegistryDto registryDto) { | ||
OtcUtils.creteDirectory(OTC_TMD_LOCATION); | ||
try (FileOutputStream fos = new FileOutputStream(registryDto.registryFileName)) { | ||
String str = OBJECT_MAPPER.writeValueAsString(registryDto); | ||
fos.write(str.getBytes()); | ||
fos.flush(); | ||
} catch (IOException e) { | ||
throw new OtcCompilerException(e); | ||
} | ||
} | ||
|
||
} |
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
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
5 changes: 5 additions & 0 deletions
5
otc-compiler/src/main/java/org/otcframework/compiler/SourceCodeCompiler.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.otcframework.compiler; | ||
|
||
public interface SourceCodeCompiler { | ||
void compileSourceCode(); | ||
} |
Oops, something went wrong.