@@ -718,7 +718,17 @@ namespace | |||||
std::cout << "Creating directory " << outputDir.getFullPathName() << std::endl; | std::cout << "Creating directory " << outputDir.getFullPathName() << std::endl; | ||||
} | } | ||||
PIPGenerator generator (pipFile, outputDir); | |||||
File juceDir; | |||||
if (args.size() > 3) | |||||
{ | |||||
juceDir = args[3].resolveAsFile(); | |||||
if (! juceDir.exists()) | |||||
ConsoleApplication::fail ("Specified JUCE modules directory doesn't exist."); | |||||
} | |||||
PIPGenerator generator (pipFile, outputDir, juceDir); | |||||
auto createJucerFileResult = generator.createJucerFile(); | auto createJucerFileResult = generator.createJucerFile(); | ||||
@@ -797,7 +807,7 @@ namespace | |||||
<< " Sets the global path for a specified os and identifier. The os should be either osx, windows or linux and the identifiers can be any of the following: " | << " Sets the global path for a specified os and identifier. The os should be either osx, windows or linux and the identifiers can be any of the following: " | ||||
<< "defaultJuceModulePath, defaultUserModulePath, vst3Path, aaxPath (not valid on linux), rtasPath (not valid on linux), androidSDKPath or androidNDKPath." << std::endl | << "defaultJuceModulePath, defaultUserModulePath, vst3Path, aaxPath (not valid on linux), rtasPath (not valid on linux), androidSDKPath or androidNDKPath." << std::endl | ||||
<< std::endl | << std::endl | ||||
<< " " << appName << " --create-project-from-pip path/to/PIP path/to/output" << std::endl | |||||
<< " " << appName << " --create-project-from-pip path/to/PIP path/to/output path/to/JUCE/modules (optional)" << std::endl | |||||
<< " Generates a JUCE project from a PIP file." << std::endl | << " Generates a JUCE project from a PIP file." << std::endl | ||||
<< std::endl | << std::endl | ||||
<< "Note that for any of the file-rewriting commands, add the option \"--lf\" if you want it to use LF linefeeds instead of CRLF" << std::endl | << "Note that for any of the file-rewriting commands, add the option \"--lf\" if you want it to use LF linefeeds instead of CRLF" << std::endl | ||||
@@ -97,8 +97,9 @@ static bool isMobileExporter (const String& exporterName) | |||||
} | } | ||||
//============================================================================== | //============================================================================== | ||||
PIPGenerator::PIPGenerator (const File& pip, const File& output) | |||||
PIPGenerator::PIPGenerator (const File& pip, const File& output, const File& juceDir) | |||||
: pipFile (pip), | : pipFile (pip), | ||||
juceDirectory (juceDir), | |||||
metadata (parsePIPMetadata()) | metadata (parsePIPMetadata()) | ||||
{ | { | ||||
if (output != File()) | if (output != File()) | ||||
@@ -290,7 +291,7 @@ ValueTree PIPGenerator::createModulePathChild (const String& moduleID) | |||||
ValueTree modulePath (Ids::MODULEPATH); | ValueTree modulePath (Ids::MODULEPATH); | ||||
modulePath.setProperty (Ids::ID, moduleID, nullptr); | modulePath.setProperty (Ids::ID, moduleID, nullptr); | ||||
modulePath.setProperty (Ids::path, {}, nullptr); | |||||
modulePath.setProperty (Ids::path, juceDirectory.getFullPathName(), nullptr); | |||||
return modulePath; | return modulePath; | ||||
} | } | ||||
@@ -367,7 +368,7 @@ ValueTree PIPGenerator::createModuleChild (const String& moduleID) | |||||
module.setProperty (Ids::ID, moduleID, nullptr); | module.setProperty (Ids::ID, moduleID, nullptr); | ||||
module.setProperty (Ids::showAllCode, 1, nullptr); | module.setProperty (Ids::showAllCode, 1, nullptr); | ||||
module.setProperty (Ids::useLocalCopy, 0, nullptr); | module.setProperty (Ids::useLocalCopy, 0, nullptr); | ||||
module.setProperty (Ids::useGlobalPath, 1, nullptr); | |||||
module.setProperty (Ids::useGlobalPath, (juceDirectory == File() ? 1 : 0), nullptr); | |||||
return module; | return module; | ||||
} | } | ||||
@@ -32,7 +32,7 @@ | |||||
class PIPGenerator | class PIPGenerator | ||||
{ | { | ||||
public: | public: | ||||
PIPGenerator (const File& pipFile, const File& outputDirectory = {}); | |||||
PIPGenerator (const File& pipFile, const File& outputDirectory = {}, const File& juceDirectory = {}); | |||||
//============================================================================== | //============================================================================== | ||||
bool hasValidPIP() const noexcept { return ! metadata[Ids::name].toString().isEmpty(); } | bool hasValidPIP() const noexcept { return ! metadata[Ids::name].toString().isEmpty(); } | ||||
@@ -78,7 +78,7 @@ private: | |||||
StringArray getPluginCharacteristics() const; | StringArray getPluginCharacteristics() const; | ||||
//============================================================================== | //============================================================================== | ||||
File pipFile, outputDirectory; | |||||
File pipFile, outputDirectory, juceDirectory; | |||||
var metadata; | var metadata; | ||||
bool isTemp = false; | bool isTemp = false; | ||||