using addRef with CRUD - crud

I'm trying to learn how to use addRef.
I think I need a way to tell addRef which field should link with 'id' in Master?
To test, I have a 'master' table:
<?php
class Model_TestMaster extends Model_Table {
public $table='testmaster';
function init(){
parent::init();
$this->addField('Description');
$this->hasMany('testslave');
}
}
and a 'slave' table:
<?php
class Model_TestSlave extends Model_Table {
public $table='testslave';
function init(){
parent::init();
$this->addField('MastersID');
$this->addField('SubDescription');
}
}
and then I set up the 'page' like this:
<?php
class page_test extends Page {
function init(){
parent::init();
$page=$this;
$tabs = $this->add('Tabs');
$crud = $tabs->addTab('Master')->add('CRUD');
$crud->setModel('testmaster');
if (! $crud->isEditing()) {
// add subCRUD
$sub_crud = $crud->addRef('testslave', array(
'extra_fields' => array('MastersID','SubDescription')));
}
}
I think I need a way to tell addRef which field should link with 'id' in Master?
It displays Ok, but when I press the button to expand the slave I get:
Application Error: Child element not found
BaseException, code: 0
Additional information:
Raised by object: Object Model_TestSlave(51cf4a73__ter_testslave_model_testslave)
element: testmaster_id
:
Stack trace:
File Object Name Stack Trace
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib/BaseException.php :63 BaseException BaseException->collectBasicData(Null)
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib/AbstractObject.php :545 BaseException BaseException->__construct("Child element not found", Null)
/ : 51cf4a73__ter_testslave_model_testslave Model_TestSlave->exception("Child element not found")
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib\SQL/Model.php :107 Loggercall_user_func_array(Array(2), Array(1))
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib/AbstractObject.php :331 51cf4a73__ter_testslave_model_testslave Model_TestSlave->exception("Child element not found")
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib\SQL/Model.php :275 51cf4a73__ter_testslave_model_testslave Model_TestSlave->getElement("testmaster_id")
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib\SQL/Many.php :79 51cf4a73__ter_testslave_model_testslave Model_TestSlave->addCondition("testmaster_id", "0000000001")
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib\SQL/Model.php :248 51cf4a73__ter_testslave SQL_Many->ref(Null)
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib\View/CRUD.php :316 asol_Test_tabs_view_htmlelement_crud_model_testmaster Model_TestMaster->ref("testslave")
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\page/test.php :15 asol_Test_tabs_view_htmlelement_crud CRUD->addRef("testslave", Array(1))
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib/AbstractObject.php :306 asol_Test page_test->init()
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib/ApiFrontend.php :130 asol Admin->add("page_Test", "Test", "Content")
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib/ApiWeb.php :428 asol Admin->layout_Content()
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib/ApiFrontend.php :39 asol Admin->addLayout("Content")
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\atk4\lib/ApiWeb.php :275 asol Admin->initLayout()
C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb/index.php :15 asol Admin->main()
Thank you,
Mark

Should be $this->hasMany('TestSlave'); not testslave. Otherwise there will be problems on Linux.
Don't use $this->addField('MastersID'); Instead use $this->hasOne('TestMaster');
Should be $crud->setModel('TestMaster'); not testmaster. Otherwise there will be problems on Linux.
Instead
$sub_crud = $crud->addRef('testslave', array(
'extra_fields' => array('MastersID','SubDescription')));
use
$sub_crud = $crud->addRef('TestSlave', array(
'extra_fields' => array('testmaster_id','SubDescription')));
Also you can use field "testmaster" in extra_fields. That'll be title field of TestMaster model.
Idea here is that when you put hasOne('ModelName') in your model, then 2 fields are created in model.
First one will have name "modelname_id" and will consist of ID of related model.
Second will have name "modelname" and will consist of title field of related model.

Related

How should I bundle a library of text files with my module?

I have the following structure in the resources directory in a module I'm building:
resources
|-- examples
|-- Arrays
| |-- file
|-- Lists
|-- file1
|-- file2
I have the following code to collect and process these files:
use v6.d;
unit module Doc::Examples::Resources;
class Resource {
has Str $.name;
has Resource #.resources;
has Resource %.resource-index;
method resource-names() {
#.resources>>.name.sort
}
method list-resources() {
self.resource-names>>.say;
}
method is-resource(Str:D $lesson) {
$lesson ~~ any self.resource-names;
}
method get-resource(Str:D $lesson) {
if !self.is-resource($lesson) {
say "Sorry, that lesson does not exist.";
return;
}
return %.resource-index{$lesson};
}
}
class Lesson is Resource {
use Doc::Parser;
use Doc::Subroutines;
has IO $.file;
method new(IO:D :$file) {
my $name = $file.basename;
self.bless(:$name, :$file)
}
method parse() {
my #parsed = parse-file $.file.path;
die "Failed parse examples from $.file" if #parsed.^name eq 'Any';
for #parsed -> $section {
my $heading = $section<meta>[0] || '';
my $intro = $section<meta>[1] || '';
say $heading.uc ~ "\n" if $heading && !$intro;
say $heading.uc if $heading && $intro;
say $intro ~ "\n" if $intro;
for $section<code>.Array {
die "Failed parse examples from $.file, check it's syntax." if $_.^name eq 'Any';
das |$_>>.trim;
}
}
}
}
class Topic is Resource {
method new(IO:D :$dir) {
my $files = dir $?DISTRIBUTION.content("$dir");
my #lessons;
my $name = $dir.basename;
my %lesson-index;
for $files.Array -> $file {
my $lesson = Lesson.new(:$file);
push #lessons, $lesson;
%lesson-index{$lesson.name} = $lesson;
}
self.bless(:$name, resources => #lessons, resource-index => %lesson-index);
}
}
class LocalResources is Resource is export {
method new() {
my $dirs = dir $?DISTRIBUTION.content('resources/examples');
my #resources;
my %resource-index;
for $dirs.Array -> $dir {
my $t = Topic.new(:$dir);
push #resources, $t;
%resource-index{$t.name} = $t;
}
self.bless(:#resources, :%resource-index)
}
method list-lessons(Str:D $topic) {
self.get-resource($topic).list-lessons;
}
method parse-lesson(Str:D $topic, Str:D $lesson) {
self.get-resource($topic).get-resource($lesson).parse;
}
}
It works. However, I'm told that this is not reliable and there there is no guarantee that lines like my $files = dir $?DISTRIBUTION.content("$dir"); will work after the module is installed or will continue to work into the future.
So what are better options for bundling a library of text files with my module that can be accessed and found by the module?
Files under the resources directory will always be available as keys to the %?RESOURCES compile-time variable if you declare them in the META6.json file this way:
"resources": [
"examples/Array/file",
]
and so on.
I've settled on a solution. As pointed out by jjmerelo, the META6.json file contains a list of resources and, if you use the comma IDE, the list of resources is automatically generated for you.
From within the module's code, the list of resources can be accessed via the $?DISTRIBUTION variable like so:
my #resources = $?DISTRIBUTION.meta<resources>
From here, I can build up my list of resources.
One note on something I discovered: the $?DISTRIBUTION variable is not accessible from a test script. It has to be placed inside a module in the lib directory of the distribution and exported.

laravel 7 pdf-to-text | Could not read pdf file

I installed this laravel package to convert pdf file into text. https://github.com/spatie/pdf-to-text
I'm getting this error:
Could not read sample_1610656868.pdf
I tried passing the file statically by putting it in public folder and by giving path of uploaded file.
Here's my controller:
public function pdftotext(Request $request)
{
if($request->hasFile('file'))
{
// Get the file with extension
$filenameWithExt = $request->file('file')->getClientOriginalName();
//Get the file name
$filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);
//Get the ext
$extension = $request->file('file')->getClientOriginalExtension();
//File name to store
$fileNameToStore = $filename.'_'.time().'.'.$extension;
//Upload File
$path = $request->file('file')->storeAS('public/ebutifier/pdf', $fileNameToStore);
}
// dd($path);
$location = public_path($path);
// $pdf = $request->input('file');
// dd($location);
// echo Pdf::getText($location, 'usr/bin/pdftotext');
$text = (new Pdf('public/ebutifier/pdf/'))
->setPdf($fileNameToStore)
->text();
return $text;
}
Not sure why it's not working any help would be appreciated.
You used spatie/pdf-to-text Package.
I also tried to use this package but it gave me this kind of error.
So, I used asika/pdf2text package and it worked properly
Asika/pdf2text pacakge
And this is my code
$path = public_path('/uploads/documents/'. $file_name);
$reader = new \Asika\Pdf2text;
$output = $reader->decode($path);
dd($output);
Hopefully, it will be helpful for you.

Correct usage of SetRootType in FlatBuffers

I'm trying to set a new custom root before parsing a JSon into a structure via flatbuffers.
The Corresponding FSB has a root_type already and I want to override it only to be able to parse it into a struct once.
The SetRootType("NonRootStructInFbsT") fails
The documentation of the API says, this can be used to override the current root which is exactly what I want to do.
std::string schemaText;
std::string schemaFile("MySchema.fbs");
if(not flatbuffers::FileExists(schemaFile.c_str())) {
error("Schema file inaccessible: ", schemaFile);
return nullptr;
}
if(not flatbuffers::LoadFile(schemaFile.c_str(), false, &schemaText)) {
error(TAG, "Failed to load schema file: ", schemaFile);
return nullptr;
}
info("Read schema file: ", schemaText.size(), schemaText);
flatbuffers::Parser parser;
if(not parser.SetRootType("NonRootStructInFbsT")) {
error("Unable to set root type: ", customRoot);
return nullptr;
}
info("Set the root type: ", customRoot);
I always get the error message
Unable to set root type: NonRootStructInFbsT
The root of a FlatBuffer can only be a table, so root_type and SetRootType will reject names of anything else, like a struct or a union.
Furthermore, the fact that the name ends in T appears to refer to an "object API" type. These are names purely in the generated code, you need to supply names as they are in the schema.
The posted code lacks call of flatbuffers::Parser::Parse with schema contents. Your code:
std::string schemaText;
std::string schemaFile("MySchema.fbs");
if(not flatbuffers::FileExists(schemaFile.c_str())) {
error("Schema file inaccessible: ", schemaFile);
return nullptr;
}
if(not flatbuffers::LoadFile(schemaFile.c_str(), false, &schemaText)) {
error(TAG, "Failed to load schema file: ", schemaFile);
return nullptr;
}
info("Read schema file: ", schemaText.size(), schemaText);
flatbuffers::Parser parser;
It is all OK, but here we have contents of schema file in schemaText and empty parser with default options. Too early to set root types. We should read the schema to parser with something like:
if(not parser.Parse(schemaText)) {
error(TAG, "Defective schema: ", parser.error_);
return nullptr;
}
After that if we reached here we have parser with schema and so in that schema we can chose also root type:
if(not parser.SetRootType("NonRootStructInFbsT")) {
error("Unable to set root type: ", customRoot);
return nullptr;
}
info("Set the root type: ", customRoot);
Note that parser.error_ is quite informative about any errors you face during parser usage.

Need to list all files in a directory on AIX

Have a program that needs to list all the files in a directory on AIX.
Have successfully done this on Windows:-
hFind = FindFirstFile(szDir, &ffd);
if (hFind == INVALID_HANDLE_VALUE)
{
fprintf(stderr,"Can not scan for files.\n");
goto MOD_EXIT;
}
do
{
if (! (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
printf("File:%s\n",ffd.cFileName);
}
}
while (FindNextFile(hFind, &ffd) != 0);
and on Linux:-
d = opendir(szDir);
if (!d)
{
fprintf(stderr,"Can not open directory '%s'.\n",szDir);
goto MOD_EXIT;
}
while(dir = readdir(d))
{
if (dir->d_type != DT_DIR)
{
printf("File:%s\n",dir->d_name);
}
}
closedir(d);
readdir appears to exist on AIX, but from the manual it would appear it only returns directories not files. The field d_type does not exist in the dirent structure.
When readdir() refers to directory entries it means entries in the directory, not subdirectories of the directory. So you can get all the names from there.
To discover if they are files or directories, the portable / reliable way is to to stat() the result. There are standard macros to test the st_mode returned in the stat buffer (e.g. S_ISDIR)

List all Defined MSBuild Variables - Equivalent to set

Is there a way to list all defined variables in an executing MSBuild project?
I'm trying to figure out exactly what paths and variables are set (to pass into WiX), and it's difficult to debug everything. Essentially, I would like something equivelent to running set at the command line. Example:
C:\Users\dsokol>set
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\dsokol\AppData\Roaming
asl.log=Destination=file
CLASSPATH=.;C:\Program Files (x86)\QuickTime\QTSystem\QTJava.zip
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
...
Except that I would like it to list out all of the MSBuild variables (such as Target, OutDir?, and all the crap I've defined in the top of the XML file. Ideally:
$(OutDir)="C:\MyOutDir\bin"
$(ProductVersion)="6.1.0"
$(Platform)="Win32"
Does such a thing exist?
Have you tried running msbuild with with /v:diag command line option? This prints out all of the properties which includes the environment variables and the properties that have been set.
I bingoogled everywhere and couldn't find anything about existing code that does it, so I came with my own approach.
First - you build a project with msbuild using the preprocess/pp parameter to put all the linked projects to a single file.
C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" /verbosity:detailed /fl /p:Configuration=Debug /p:Platform=x86 MyApp.csproj /pp:flatproject.proj >detailedlog.txt
That already gives you a single project xml file with all properties that were set (perhaps except the environment variables or the ones passed with the /p parameter to msbuild or perhaps some others that might be set otherwise). For me that's over 800 properties. Now if you want to compile a list in alphabetical order - you could do that with a little bit of code - in my case C# and XAML:
<Window x:Class="WpfApplication4.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApplication4"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Grid>
<TextBox
x:Name="tb"
VerticalAlignment="Stretch"
HorizontalScrollBarVisibility="Visible"
VerticalScrollBarVisibility="Visible"/>
</Grid>
</Window>
C# bit:
public partial class MainWindow : Window
{
Dictionary<string,string> properties = new Dictionary<string, string>();
public MainWindow()
{
InitializeComponent();
var xml = new XmlDocument();
xml.LoadXml(File.ReadAllText(#"c:\git\Photos\Photos\AppStubCS\AppStubCS.Windows\x.prop"));
PopulateProperties(xml);
SortAndOutput();
}
private void SortAndOutput()
{
var sb = new StringBuilder();
foreach (var kvp in properties.OrderBy(kvp => kvp.Key))
{
sb.AppendFormat("{0}: {1}\r\n", kvp.Key, kvp.Value);
}
this.tb.Text = sb.ToString();
}
private void PopulateProperties(XmlNode xml)
{
if (xml.Name == "PropertyGroup")
{
foreach (var childNode in xml.ChildNodes.OfType<XmlElement>())
{
var name = childNode.Name;
var val = childNode.InnerText;
if (properties.ContainsKey(name))
{
properties[name] = val;
}
else
{
properties.Add(name, val);
}
}
}
else
{
foreach (var childNode in xml.ChildNodes.OfType<XmlElement>())
{
PopulateProperties(childNode);
}
}
}
}
My list:
_AdjustedPlatform
_AppContainsManagedCodeForInjection
_AppContainsManagedCodeInItsClosure
_AppxBundlePlatformsForNamingIntermediate
_AppxManifestXmlFileName
_AppxMSBuildTaskAssembly
_AppxMSBuildToolsPath
_AppxPackageConfiguration
_AssemblyTimestampAfterCompile
_AssemblyTimestampBeforeCompile
_ContinueOnError
_ConvertedPlatform
_CoreRuntimeMSBuildTaskAssembly
_CoreRuntimePackageId
_CreateAppxBundleFilesDependsOn
_CreateAppxBundlePlatformSpecificArtifactsDependsOn
_CreateAppxPackageDependsOn
_CustomAppxManifestUsed
_DebugSymbolsProduced
_DeploymentApplicationDir
_DeploymentApplicationFolderName
_DeploymentApplicationManifestIdentity
_DeploymentApplicationUrl
_DeploymentBaseManifest
_DeploymentBuiltMinimumRequiredVersion
_DeploymentBuiltUpdateInterval
_DeploymentBuiltUpdateIntervalUnits
_DeploymentComponentsUrl
_DeploymentCopyApplicationManifest
_DeploymentDeployManifestIdentity
_DeploymentFileMappingExtension
_DeploymentManifestType
_DeploymentManifestVersion
_DeploymentPublishableProjectDefault
_DeploymentTargetApplicationManifestFileName
_DeploymentUrl
_DocumentationFileProduced
_EmbedFileResfilePath
_ExtractPlatforms
_FileNameToRemove
_FileToBuild
_FindDependencies
_FrameworkSdkNames
_GatekeeperCmd
_GatekeeperPlatformTarget
_GCTODIKeepDuplicates
_GCTODIKeepMetadata
_GenerateAppxManifestDependsOn
_GenerateAppxPackageBaseDependsOn
_GenerateAppxPackageDependsOn
_GenerateAppxPackageRecipeDependsOn
_GenerateAppxUploadPackageRecipeDependsOn
_GenerateBindingRedirectsIntermediateAppConfig
_GenerateProjectPriFileDependsOn
_GetChildProjectCopyToOutputDirectoryItems
_GetPackagePropertiesDependsOn
_IlcBuildType
_IlcExePath
_IlcExitCode
_IlcExternalReferencePath
_IlcFrameworkDependencies
_IlcInputPath
_IlcIntermediatePath
_IlcInvocationParameters
_IlcKeepIntermediates
_IlcMinBehavioralExitCode
_IlcParameters
_IlcResponseFile
_IlcRootPath
_IlcSharedAssemblyDefinitionFile
_IlcSharedAssemblyRootPath
_IlcSuppressPDBWarnings
_IlcVerbosity
_IntermediateWindowsMetadataPath
_InvalidConfigurationError
_InvalidConfigurationMessageText
_InvalidConfigurationWarning
_LayoutResfilesPath
_MultipleQualifiersPerDimensionFound
_MultipleQualifiersPerDimensionFoundPath
_NetCoreFrameworkInjectionNeeded
_NuGetRuntimeIdentifierPlatformTargetSuffix
_NuGetRuntimeIdentifierWithoutAot
_NuGetTargetFallbackMoniker
_OriginalConfiguration
_OriginalPlatform
_PackagingOutputsIncludesFramework
_PdbOutputRoot
_PlatformTargetForCoreRuntime
_PlatformTargetForIlcVersion
_PriConfigXmlPath
_PriResfilesPath
_ProjectArchitectureOutput
_ProjectArchitecturesFilePath
_ProjectDefaultTargets
_ProjectNPlatformSupported
_ProjectNProjectSupported
_ProjectNToolchainEnabled
_ProjectPriFileName
_ProjectPriFullPathOriginal
_ProjectSpecificProjectJsonFile
_QualifiersPath
_Rebuilding
_ResolveReferenceDependencies
_ResourcesResfilesPath
_ReverseMapProjectPriDirectory
_ReverseMapProjectPriFileName
_ReverseMapProjectPriUploadDirectory
_ReverseMapProjectPriUploadFileName
_SGenDllCreated
_SGenDllName
_SGenGenerateSerializationAssembliesConfig
_ShouldUnsetParentConfigurationAndPlatform
_SolutionConfigurationContentsToUse
_StoreManifestSchemaDir
_SupportEmbedFileResources
_SupportXbfAsEmbedFileResources
_TargetPlatform
_TargetPlatformIsWindowsPhone
_TargetPlatformMetadataPath
_TargetsCoreRuntime
_TargetToBuild
_TransformedAppxManifestXmlFile
_TransformedProjectPriFullPath
_WindowsMetadataOutputPath
_WindowsSDKSignToolPath
_WinMDDebugSymbolsOutputPath
_WinMDDocFileOutputPath
_WireUpCoreRuntimeExitCode
_WireUpCoreRuntimeMsg
_WireUpCoreRuntimeTaskExecuted
_XamlTemporaryAssemblyPath_
AddAppConfigToBuildOutputs
AddBuildInfoToAssembly
AddSyntheticProjectReferencesForSolutionDependencies
AfterBuildLinkTargets
AllOutputGroupsDependsOn
AllowedPlatformsForProjectN
AllowedReferenceAssemblyFileExtensions
AllowedReferenceRelatedFileExtensions
AllowLocalNetworkLoopback
AltPlatformTarget
AlwaysUseNumericalSuffixInItemNames
AppConfig
AppConfigForCompiler
AppDesignerFolder
AppLocalMetadataPath
AppxBundle
AppxBundleAutoResourcePackageQualifiers
AppxBundleDefaultValueUsed
AppxBundleDir
AppxBundleExtension
AppxBundleFolderSuffix
AppxBundleMainPackageFileMapGeneratedFilesListPath
AppxBundleMainPackageFileMapIntermediatePath
AppxBundleMainPackageFileMapIntermediatePrefix
AppxBundleMainPackageFileMapIntermediatePriPath
AppxBundleMainPackageFileMapPath
AppxBundleMainPackageFileMapPrefix
AppxBundleMainPackageFileMapSuffix
AppxBundleManifestVersion
AppxBundleOutput
AppxBundlePlatforms
AppxBundlePlatformsForNaming
AppxBundlePlatformSpecificArtifactsListPath
AppxBundlePlatformSpecificUploadArtifactsListPath
AppxBundlePriConfigXmlForMainPackageFileMapFileName
AppxBundlePriConfigXmlForSplittingFileName
AppxBundleProducingPlatform
AppxBundleResourcePacksProducingPlatform
AppxBundleSplitResourcesGeneratedFilesListPath
AppxBundleSplitResourcesPriPath
AppxBundleSplitResourcesPriPrefix
AppxBundleSplitResourcesQualifiersPath
AppxCopyLocalFilesOutputGroupIncludeXmlFiles
AppxDefaultHashAlgorithmId
AppxDefaultResourceQualifiers
AppxDefaultResourceQualifiers_UAP
AppxDefaultResourceQualifiers_Windows_80
AppxDefaultResourceQualifiers_Windows_81
AppxDefaultResourceQualifiers_Windows_82
AppxDefaultResourceQualifiers_Windows_Phone
AppxFilterOutUnusedLanguagesResourceFileMaps
AppxGeneratePackageRecipeEnabled
AppxGeneratePriEnabled
AppxGeneratePrisForPortableLibrariesEnabled
AppxGetPackagePropertiesEnabled
AppxHarvestWinmdRegistration
AppxHashAlgorithmId
AppxIntermediateExtension
AppxLayoutDir
AppxLayoutFolderName
AppxMainPackageOutput
AppxMSBuildTaskAssembly
AppxMSBuildToolsPath
AppxOSMaxVersionTested
AppxOSMaxVersionTestedReplaceManifestVersion
AppxOSMinVersion
AppxOSMinVersionReplaceManifestVersion
AppxPackage
AppxPackageAllowDebugFrameworkReferencesInManifest
AppxPackageArtifactsDir
AppxPackageDir
AppxPackageDirInProjectDir
AppxPackageDirName
AppxPackageDirWasSpecified
AppxPackageExtension
AppxPackageFileMap
AppxPackageIncludePrivateSymbols
AppxPackageIsForStore
AppxPackageName
AppxPackageNameNeutral
AppxPackageOutput
AppxPackagePipelineVersion
AppxPackageRecipe
AppxPackageSigningEnabled
AppxPackageTestDir
AppxPackageValidationEnabled
AppxPackagingArchitecture
AppxPackagingInfoFile
AppxPPPrefix
AppxPrependPriInitialPath
AppxPriConfigXmlDefaultSnippetPath
AppxPriConfigXmlPackagingSnippetPath
AppxPriInitialPath
AppxResourcePackOutputBase
AppxSkipUnchangedFiles
AppxStoreContainer
AppxStoreContainerExtension
AppxStrictManifestValidationEnabled
AppxSymbolPackageEnabled
AppxSymbolPackageExtension
AppxSymbolPackageOutput
AppxSymbolStrippedDir
AppxTestLayoutEnabled
AppxUploadBundleDir
AppxUploadBundleMainPackageFileMapGeneratedFilesListPath
AppxUploadBundleMainPackageFileMapIntermediatePath
AppxUploadBundleMainPackageFileMapIntermediatePriPath
AppxUploadBundleMainPackageFileMapPath
AppxUploadBundleOutput
AppxUploadBundlePriConfigXmlForMainPackageFileMapFileName
AppxUploadBundlePriConfigXmlForSplittingFileName
AppxUploadBundleSplitResourcesGeneratedFilesListPath
AppxUploadBundleSplitResourcesPriPath
AppxUploadBundleSplitResourcesQualifiersPath
AppxUploadLayoutDir
AppxUploadLayoutFolderName
AppxUploadMainPackageOutput
AppxUploadPackageArtifactsDir
AppxUploadPackageDir
AppxUploadPackageFileMap
AppxUploadPackageOutput
AppxUploadPackageRecipe
AppxUploadPackagingInfoFile
AppxUploadSymbolPackageOutput
AppxUploadSymbolStrippedDir
AppxUseHardlinksIfPossible
AppxUseResourceIndexerApi
AppxValidateAppxManifest
AppxValidateStoreManifest
AssemblyFile
AssemblyFoldersSuffix
AssemblyName
AssemblySearchPaths
AssignTargetPathsDependsOn
AutoIncrementPackageRevision
AutoUnifyAssemblyReferences
AvailablePlatforms
BaseIntermediateOutputPath
BaseNuGetRuntimeIdentifier
BeforeRunGatekeeperTargets
BuildAppxSideloadPackageForUap
BuildAppxUploadPackageForUap
BuildCompileAction
BuildDependsOn
BuildGenerateSourcesAction
BuildId
BuildInfoBinPath
BuildInfoConfigFileName
BuildInfoFileName
BuildInfoPath
BuildInfoResourceFileName
BuildInfoResourceLogicalName
BuildInfoTargets
BuildingInTeamBuild
BuildingProject
BuildInParallel
BuildLabel
BuildLinkAction
BuildProjectReferences
BuildTimestamp
BuiltProjectOutputGroupDependsOn
CAExcludePath
CanUseProjectN
CleanDependsOn
CleanFile
CleanPackageAction
CodeAnalysisApplyLogFileXsl
CodeAnalysisFailOnMissingRules
CodeAnalysisForceOutput
CodeAnalysisGenerateSuccessFile
CodeAnalysisIgnoreGeneratedCode
CodeAnalysisIgnoreInvalidTargets
CodeAnalysisIgnoreMissingIndirectReferences
CodeAnalysisInputAssembly
CodeAnalysisLogFile
CodeAnalysisModuleSuppressionsFile
CodeAnalysisOutputToConsole
CodeAnalysisOverrideRuleVisibilities
CodeAnalysisPath
CodeAnalysisQuiet
CodeAnalysisRuleDirectories
CodeAnalysisRuleSet
CodeAnalysisRuleSetDirectories
CodeAnalysisSaveMessagesToReport
CodeAnalysisSearchGlobalAssemblyCache
CodeAnalysisStaticAnalysisDirectory
CodeAnalysisSucceededFile
CodeAnalysisSummary
CodeAnalysisTargets
CodeAnalysisTimeout
CodeAnalysisTLogFile
CodeAnalysisTreatWarningsAsErrors
CodeAnalysisUpdateProject
CodeAnalysisUseTypeNameInSuppression
CodeAnalysisVerbose
CodeAnalysisVSSku
ComFilesOutputGroupDependsOn
CommonTargetsPath
CommonXamlResourcesDirectory
CompileDependsOn
CompileLicxFilesDependsOn
CompileTargetNameForTemporaryAssembly
ComputeIntermediateSatelliteAssembliesDependsOn
ComReferenceExecuteAsTool
ComReferenceNoClassMembers
Configuration
ConfigurationName
ConsiderPlatformAsProcessorArchitecture
ContentFilesProjectOutputGroupDependsOn
ContinueOnError
CopyBuildOutputToOutputDirectory
CopyLocalFilesOutputGroupDependsOn
CopyNuGetImplementations
CopyOutputSymbolsToOutputDirectory
CopyWinmdArtifactsOutputGroupDependsOn
CoreBuildDependsOn
CoreCleanDependsOn
CoreCompileDependsOn
CoreResGenDependsOn
CoreRuntimeSDKLocation
CoreRuntimeSDKName
CreateCustomManifestResourceNamesDependsOn
CreateHardLinksForCopyAdditionalFilesIfPossible
CreateHardLinksForCopyFilesToOutputDirectoryIfPossible
CreateHardLinksForCopyLocalIfPossible
CreateHardLinksForPublishFilesIfPossible
CreateManifestResourceNamesDependsOn
CreateSatelliteAssembliesDependsOn
CscToolPath
CSharpCoreTargetsPath
CSharpTargetsPath
CURRENTVSINSTALLDIR
CustomAfterMicrosoftCommonProps
CustomAfterMicrosoftCommonTargets
CustomAfterMicrosoftCSharpTargets
CustomBeforeMicrosoftCommonProps
CustomBeforeMicrosoftCommonTargets
CustomBeforeMicrosoftCSharpTargets
CustomVersionNumber_Build
CustomVersionNumber_Build2
CustomVersionNumber_FullVersion
CustomVersionNumber_Major
CustomVersionNumber_Minor
CustomVersionNumber_Revision
CVN_Len
DebugSymbols
DebugSymbolsProjectOutputGroupDependsOn
DebugType
DefaultLanguage
DefaultLanguageSourceExtension
DeferredValidationErrorsFileName
DefineCommonCapabilities
DefineCommonItemSchemas
DefineCommonReferenceSchemas
DefineConstants
DelaySign
DesignTimeAssemblySearchPaths
DesignTimeAutoUnify
DesignTimeFindDependencies
DesignTimeFindRelatedFiles
DesignTimeFindSatellites
DesignTimeFindSerializationAssemblies
DesignTimeIgnoreVersionForFrameworkReferences
DesignTimeIntermediateOutputPath
DesignTimeResolveAssemblyReferencesDependsOn
DesignTimeResolveAssemblyReferencesStateFile
DesignTimeSilentResolution
DevEnvDir
DisableXbfGeneration
DocumentationProjectOutputGroupDependsOn
DotNetNativeRuntimeSDKMoniker
DotNetNativeSharedAssemblySDKMoniker
DotNetNativeTargetConfiguration
DotNetNativeVCLibsDependencySDKMoniker
DTARUseReferencesFromProject
EmbeddedWin32Manifest
EnableAppLocalFXWorkaround
EnableDotNetNativeCompatibleProfile
EnableFavorites
EnableNDE
EnableSigningChecks
ErrorEndLocation
ErrorReport
ExpandSDKAllowedReferenceExtensions
ExpandSDKReferencesDependsOn
ExportWinMDFile
ExtensionsToDeleteOnClean
ExtPackagesRoot
FacadeWinmdPath
FaceNextSdkRoot
FaceSdk_Bin_Path
FaceSdk_Inc_Path
FaceSdkWrapperRoot
FakesBinPath
FakesCommandLineArguments
FakesCompilationProperties
FakesContinueOnError
FakesGenerateBeforeBuildDependsOn
FakesImported
FakesIntermediatePath
FakesMSBuildPath
FakesOutputPath
FakesResolveAssemblyReferencesStateFile
FakesTargets
FakesTasks
FakesToolsPath
FakesVerbosity
FallbackCulture
FileAlignment
FinalAppxManifestName
FinalAppxPackageRecipe
FinalAppxUploadManifestName
FinalAppxUploadPackageRecipe
FinalDefineConstants
FindInvalidProjectReferences
FindInvalidProjectReferencesDependsOn
Framework20Dir
Framework30Dir
Framework35Dir
Framework40Dir
FrameworkDir
FrameworkInjectionLockFile
FrameworkInjectionPackagesDirectory
FrameworkPathOverride
FrameworkRegistryBase
FrameworkSDKDir
FullReferenceAssemblyNames
GenerateAdditionalSources
GenerateAppxPackageOnBuild
GenerateBindingRedirectsOutputType
GenerateBuildInfoConfigFile
GenerateClickOnceManifests
GenerateCompiledExpressionsTempFilePathForEditing
GenerateCompiledExpressionsTempFilePathForTypeInfer
GenerateCompiledExpressionsTempFilePathForValidation
GenerateManifestsDependsOn
GenerateResourceMSBuildArchitecture
GenerateResourceMSBuildRuntime
GenerateTargetFrameworkAttribute
GetCopyToOutputDirectoryItemsDependsOn
GetFrameworkPathsDependsOn
GetPackagingOutputsDependsOn
GetTargetPathDependsOn
GetTargetPathWithTargetPlatformMonikerDependsOn
HasSharedItems
HighEntropyVA
IlcIntermediateRootPath
IlcOutputPath
IlcParameters
ILCPDBDir
IlcTargetPlatformSdkLibPath
ImplicitlyExpandTargetFramework
ImplicitlyExpandTargetFrameworkDependsOn
ImplicitlyExpandTargetPlatform
Import_RootNamespace
ImportXamlTargets
IncludeBuiltProjectOutputGroup
IncludeComFilesOutputGroup
IncludeContentFilesProjectOutputGroup
IncludeCopyLocalFilesOutputGroup
IncludeCopyWinmdArtifactsOutputGroup
IncludeCustomOutputGroupForPackaging
IncludeDebugSymbolsProjectOutputGroup
IncludeDocumentationProjectOutputGroup
IncludeFrameworkReferencesFromNuGet
IncludeGetResolvedSDKReferences
IncludePriFilesOutputGroup
IncludeProjectPriFile
IncludeSatelliteDllsProjectOutputGroup
IncludeSDKRedistOutputGroup
IncludeServerNameInBuildInfo
IncludeSGenFilesOutputGroup
IncludeSourceFilesProjectOutputGroup
InProcessMakePriExtensionPath
InsertReverseMap
IntermediateOutputPath
IntermediateUploadOutputPath
InternalBuildOutDir
InternalBuildOutputPath
InteropOutputPath
Language
LayoutDir
LCMSBuildArchitecture
LoadTimeSensitiveProperties
LoadTimeSensitiveTargets
LocalAssembly
LocalEspcPath
LumiaPlatform
MakeAppxExeFullPath
MakePriExeFullPath
MakePriExtensionPath
MakePriExtensionPath_x64
ManagedWinmdInprocImplementation
MarkupCompilePass1DependsOn
MarkupCompilePass2DependsOn
MaxTargetPath
MergedOutputCodeAnalysisFile
MergeInputCodeAnalysisFiles
MetadataNamespaceUri
MicrosoftCommonPropsHasBeenImported
MinimumVisualStudioVersion
MrmSupportLibraryArchitecture
MsAppxPackageTargets
MSBuildAllProjects
MSBuildExtensionsPath64Exists
MsTestToolsTargets
NativeCodeAnalysisTLogFile
NetfxCoreRuntimeSettingsTargets
NetfxCoreRuntimeTargets
NoCompilerStandardLib
NonExistentFile
NoStdLib
NoWarn
NoWin32Manifest
NuGetProps
NuGetRuntimeIdentifier
NuGetTargetFrameworkMonikerToInject
NuGetTargetMoniker
NuGetTargetMonikerToInject
NuGetTargets
OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration
OnXamlPreCompileErrorTarget
Optimize
OsVersion
OutDir
OutDirWasSpecified
OutOfProcessMakePriExtensionPath
OutputPath
OutputType
OverwriteReadOnlyFiles
PackageAction
PackageCertificateKeyFile
PackagingDirectoryWritesLogPath
PackagingFileWritesLogPath
PdbCopyExeFullPath
PdbFile
PdbOutputDir
Platform
PlatformName
PlatformSpecificBundleArtifactsListDir
PlatformSpecificBundleArtifactsListDirInProjectDir
PlatformSpecificBundleArtifactsListDirName
PlatformSpecificBundleArtifactsListDirWasSpecified
PlatformSpecificUploadBundleArtifactsListDir
PlatformSpecificUploadBundleArtifactsListDirInProjectDir
PlatformTarget
PlatformTargetAsMSBuildArchitecture
PlatformTargetAsMSBuildArchitectureExplicitlySet
PostBuildEventDependsOn
PreBuildEventDependsOn
Prefer32Bit
PreferredUILang
Prep_ComputeProcessXamlFilesDependsOn
PrepareForBuildDependsOn
PrepareForRunDependsOn
PrepareLayoutDependsOn
PrepareLibraryLayoutDependsOn
PrepareResourceNamesDependsOn
PrepareResourcesDependsOn
PrevWarningLevel
PriIndexName
ProcessorArchitecture
ProcessorArchitectureAsPlatform
ProduceAppxBundle
ProgFiles32
ProjectDesignTimeAssemblyResolutionSearchPaths
ProjectDir
ProjectExt
ProjectFileName
ProjectFlavor
ProjectGuid
ProjectLockFile
ProjectName
ProjectNProfileEnabled
ProjectNSettingsTargets
ProjectNTargets
ProjectPath
ProjectPriFileName
ProjectPriFullPath
ProjectPriIndexName
ProjectPriUploadFullPath
ProjectTypeGuids
PublishableProject
PublishBuildDependsOn
PublishDependsOn
PublishDir
PublishOnlyDependsOn
PublishPipelineCollectFilesCore
RebuildDependsOn
RebuildPackageAction
RedirectionTarget
RegisterAssemblyMSBuildArchitecture
RegisterAssemblyMSBuildRuntime
RemoveAssemblyFoldersIfNoTargetFramework
ReportingServicesTargets
ResGenDependsOn
ResGenExecuteAsTool
ResgenToolPath
ResolveAssemblyReferencesDependsOn
ResolveAssemblyReferencesSilent
ResolveAssemblyReferencesStateFile
ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch
ResolveComReferenceMSBuildArchitecture
ResolveComReferenceSilent
ResolveComReferenceToolPath
ResolveNuGetPackageAssetsDependsOn
ResolveNuGetPackages
ResolveReferencesDependsOn
ResolveSDKReferencesDependsOn
RootNamespace
RunCodeAnalysisDependsOn
RunCodeAnalysisInputs
RunCodeAnalysisOnThisProject
RunDependsOn
RunMergeNativeCodeAnalysisDependsOn
RunNativeCodeAnalysisInputs
SafeIntDir
SatelliteDllsProjectOutputGroupDependsOn
SDKExtensionDirectoryRoot
SDKIdentifier
SDKRedistOutputGroupDependsOn
SDKReferenceDirectoryRoot
SDKReferenceRegistryRoot
SDKReferenceWarnOnMissingMaxPlatformVersion
SDKRefVersionToUse
SDKVersion
SDKVersionToUse
SGenFilesOutputGroupDependsOn
SGenMSBuildArchitecture
SGenShouldGenerateSerializer
SGenUseKeep
SGenUseProxyTypes
SharedGUID
ShouldMarkCertainSDKReferencesAsRuntimeOnly
ShouldUnsetParentConfigurationAndPlatform
SignAppxPackageExeFullPath
SignToolPath
SkipCopyUnchangedFiles
SkipILCompilation
SkipIntermediatePriGenerationForResourceFiles
SkipMergingFrameworkResources
SolutionDir
SolutionDirNoTrailingBackspace
SolutionExt
SolutionFileName
SolutionName
SolutionPath
SourceFilesProjectOutputGroupDependsOn
StandardBuildPipeline
StoreManifestName
StripPrivateSymbols
SubsystemVersion
SupportWindows81SDKs
SupportWindowsPhone81SDKs
SuppressWarningsInPass1
SyncLibsForDotNetNativeSharedFrameworkPackage
SynthesizeLinkMetadata
TargetCulture
TargetDeployManifestFileName
TargetDir
TargetedFrameworkDir
TargetedSDKArchitecture
TargetedSDKConfiguration
TargetExt
TargetFileName
TargetFrameworkAsMSBuildRuntime
TargetFrameworkDirectory
TargetFrameworkIdentifier
TargetFrameworkMoniker
TargetFrameworkMonikerAssemblyAttributesFileClean
TargetFrameworkMonikerAssemblyAttributesPath
TargetFrameworkMonikerAssemblyAttributeText
TargetFrameworkProfile
TargetFrameworkVersion
TargetName
TargetPath
TargetPlatformDisplayName
TargetPlatformIdentifier
TargetPlatformIdentifierWindows81
TargetPlatformIdentifierWindowsPhone81
TargetPlatformMinVersion
TargetPlatformMoniker
TargetPlatformRegistryBase
TargetPlatformResourceVersion
TargetPlatformSdkMetadataLocation
TargetPlatformSdkPath
TargetPlatformSdkRootOverride
TargetPlatformVersion
TargetPlatformVersionWindows81
TargetPlatformVersionWindowsPhone81
TargetPlatformWinMDLocation
TargetRuntime
TargetsPC
TargetsPhone
TaskKeyToken
TaskVersion
TreatWarningsAsErrors
UapAppxPackageBuildModeCI
UapAppxPackageBuildModeSideloadOnly
UapAppxPackageBuildModeStoreUpload
UapBuildPipeline
UapDefaultAssetScale
UnmanagedRegistrationDependsOn
UnmanagedUnregistrationDependsOn
UnregisterAssemblyMSBuildArchitecture
UnregisterAssemblyMSBuildRuntime
UseCommonOutputDirectory
UseDotNetNativeSharedAssemblyFrameworkPackage
UseDotNetNativeToolchain
UseHostCompilerIfAvailable
UseIncrementalAppxRegistration
UseNetNativeCustomFramework
UseOSWinMdReferences
UseRTMSdk
UseSharedCompilation
UseSourcePath
UseSubFolderForOutputDirDuringMultiPlatformBuild
UseTargetPlatformAsNuGetTargetMoniker
UseVSHostingProcess
Utf8Output
ValidatePresenceOfAppxManifestItemsDependsOn
VCInstallDir
VCLibs14SDKName
VCLibsTargetConfiguration
VersionIntDir
VisualStudioVersion
WarningLevel
WebReference_EnableLegacyEventingModel
WebReference_EnableProperties
WebReference_EnableSQLTypes
Win32Manifest
Windows8SDKInstallationFolder
WindowsAppContainer
WindowsSdkPath
WinMDExpOutputPdb
WinMDExpOutputWindowsMetadataFilename
WinMdExpToolPath
WinMdExpUTF8Ouput
WinMDOutputDocumentationFile
WireUpCoreRuntimeGates
WireUpCoreRuntimeOutputPath
WMSJSProject
WMSJSProjectDirectory
WorkflowBuildExtensionAssemblyName
WorkflowBuildExtensionKeyToken
WorkflowBuildExtensionVersion
XamlBuildTaskAssemblyName
XamlBuildTaskLocation
XamlBuildTaskPath
XAMLCompilerVersion
XAMLFingerprint
XAMLFingerprintIgnorePaths
XamlGenCodeFileNames
XamlGeneratedOutputPath
XamlGenMarkupFileNames
XamlPackagingRootFolder
XamlPass2FlagFile
XamlRequiresCompilationPass2
XamlRootsLog
XamlSavedStateFileName
XamlSavedStateFilePath
XamlTemporaryAssemblyName
XsdCodeGenCollectionTypes
XsdCodeGenEnableDataBinding
XsdCodeGenGenerateDataTypesOnly
XsdCodeGenGenerateInternalTypes
XsdCodeGenGenerateSerializableTypes
XsdCodeGenImportXmlTypes
XsdCodeGenNamespaceMappings
XsdCodeGenPreCondition
XsdCodeGenReuseTypesFlag
XsdCodeGenReuseTypesMode
XsdCodeGenSerializerMode
XsdCodeGenSupportFx35DataTypes
YieldDuringToolExecution
For some reason, /v:diagnostic did not dump the environment variables for me.
I tried some stuff, and then the sort-of obvious simple thing worked. Try:
<Exec Command='set' />
You might want to try Debugging MSBuild script with VisualStudio. I haven't tried it, but it seems like it could allow you to step through a script and also list variables.
I know this question is a little old and I'm not sure if there's actually a way to enumerate all defined property names in MSBuild parlance (I'm not aware of one), but I would recommend using the /bl (/binlog[:filename]) switch and loading the resulting binary log in the MSBuild Binary and Structured Log Viewer which will not only tell you every property defined and its value, but also show what the values were as each target or task is called throughout the build. This tool has been incredibly useful for learning the inner workings and finding appropriate extension points when customizing MSBuild and can even take you to the line of MSBuild xml that was being executed when you double click on events in the log. There's also a Visual Studio extension mentioned on the site linked that can be used to troubleshoot design time builds (when VS calls MSBuild for things like XAML previews, etc.)