ADF Skin build ignores SVG images - build

I am currently developing a Skin for a ADF Fusion Web Application using both, the JDeveloper 11.1.2.0 and the Skin Editor 11.1.2.0.
For some background-image rules I use SVG images. However these SVG images are not copied to the right folder in my lookAndFeel.jar during deployment. All my PNG images are copied to in following maner
lookAndFeel.jar\META-INF\adf\skins\<skinname>\images\*.png
where my SVG images are left behind in
lookAndFeel.jar\skins\<skinname>\images\*.svg
I was able to work around this issue with the following command, leveraging 7zip:
"C:\Program Files\7-Zip\7z.exe" a lookAndFeel.jar META-INF\adf\skins\<skinname>\images\*.svg
That adds those SVG images post deploy into the right folder of my JAR file.
However this is not very elegant, and I wonder if there is a better solution, which I can adopt later in the automatic build job. Is there a way to configure the skin build, to include the SVG images? Or is it extensible with an Ant file? If so, could somebody direct me into the right direction, as I never used Ant myself before?
edit
Both my PNG and SVG images are in the same folder, so the Source-path seems to be right. And I found the following section in my Project File:
<hash n="oracle.jdeveloper.compiler.OjcConfiguration">
<list n="copyRes">
<string v=".cpx"/>
<string v=".dcx"/>
<string v=".ejx"/>
<string v=".gif"/>
<string v=".ini"/>
<string v=".jpeg"/>
<string v=".jpg"/>
<string v=".png"/>
<string v=".properties"/>
<string v=".sva"/>
<string v=".svg"/>
<string v=".tag"/>
<string v=".tld"/>
<string v=".wsdl"/>
<string v=".xcfg"/>
<string v=".xlf"/>
<string v=".xml"/>
<string v=".xsd"/>
<string v=".xsl"/>
</list>
There are both PNG and SVG listed. I did not found another place where PNG was in my Project File.

This file might be excluded from the project's deployment
There are two things to check:
Make sure that the Project's Source Paths includes all
Edit your deployment profile, and make sure you include any files from filter under your images folder, or even add the rule *.svg yourself rule if not there

Related

Office menu control using Add-in

I have developed a plugin to control the enable state of a specified menu and ribbon control in Office 2016.
XML files follow this format:
<?xml version="1.0" encoding="utf-8" ?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<commands>
<command idMso="FileSendAsAttachment" enabled="false"/>
<command idMso="FileEmailAsPdfEmailAttachment" enabled="false"/>
<command idMso="FileEmailAsXpsEmailAttachment" enabled="false"/>
<command idMso="FileInternetFax" enabled="false"/>
...
</commands>
<ribbon>
</ribbon>
<backstage>
</backstage>
</customUI>
After installing the add-in, depending on the policy, the agent may need to temporarily enable certain menus.
So, I modified only the enable property of the control in the XML file and restarted Office, but all the menus are enabled.
(However, when I replace it with the original XML file, it is marked as disable again.)
My addin was registered via regsvr32.exe, and the registry was written in HKCU.
(Windows is 64bit, Office 2016 is 32bit.)
Has anyone had a similar problem?
What is causing this?
After installing the add-in, I modified the XML file using notepad. And I found that it is stored in utf-8 encoding way.
I noticed that the format is broken because the BOM is inserted in the first byte of the XML file. If you save the file as ANSI, it works fine.
I hope you will not make the same mistake as me !
use utf-16
<commands>
<command idMso="FileSendAsAttachment" enabled="false"/>
<command idMso="FileEmailAsPdfEmailAttachment" enabled="false"/>
<command idMso="FileEmailAsXpsEmailAttachment" enabled="false"/>
<command idMso="FileInternetFax" enabled="false"/>
...
</commands>
<ribbon>
</ribbon>
<backstage>
</backstage>
</customUI>

How to use the Web Publishing Pipeline and Web Deploy (MSDEPLOY) to Publish a Console Application?

I would like to use web deploy to publish a Visual Studio "Console" application to a folder on the target system.
I have had some luck, and have been able to produce something similar to what I need, but not quite.
I've added the following to the console .csproj:
added the following projectName.wpp.targets file
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
and I've added the following projectName.wpp.targets:
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<DeployAsIisApp>false</DeployAsIisApp>
<IncludeSetAclProviderOnDestination>false</IncludeSetAclProviderOnDestination>
</PropertyGroup>
<ItemGroup>
<FilesForPackagingFromProject Include="$(IntermediateOutputPath)$(TargetFileName).config">
<DestinationRelativePath>bin\%(RecursiveDir)%(FileName)%(Extension)</DestinationRelativePath>
<FromTarget>projectName.wpp.targets</FromTarget>
</FilesForPackagingFromProject>
</ItemGroup>
</Project>
I then edit the .SetParameters.xml file as follows:
<parameters>
<setParameter name="IIS Web Application Name" value="c:\company\project" />
</parameters>
When I then deploy using the generated .cmd file, I get all the files deployed to C:\company\project\bin.
That's not bad, but I'd like to do better. In particular, I'd like to omit the "bin" folder and put all files in the "C:\company\project" folder, and I'd like to be able to specify the ACLs
Has anybody been able to work around these problems?
Ok, so here's the way how to omit the 'bin' folder.
First of all, I'd like to emphasize that all this msdeploy-related stuff is for web apps deployment, and 'bin' folder seems for me to be almost hardcoded deeply inside. So if you want to get rid of it - you have to do some dirty things. Which I did.
We'll have to change $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets project a little bit, so it's better to change not it, but it's copy.
Steps:
1.Backup $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets(alternatively, you could install MSBuild.Microsoft.VisualStudio.Web.targets package, redirect your csproj file to Microsoft.WebApplication.targets file obtained from package and work with it).
2. In the $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplicaton.targets find the xml node which looks like <CopyPipelineFiles PipelineItems="#(FilesForPackagingFromProject)"(there are several ones of them, take the one from the line ~2570).
3. Comment the node out, replace with the custom one, so eventually it will look like:
<!--
<CopyPipelineFiles PipelineItems="#(FilesForPackagingFromProject)"
SourceDirectory="$(WebPublishPipelineProjectDirectory)"
TargetDirectory="$(WPPAllFilesInSingleFolder)"
SkipMetadataExcludeTrueItems="True"
UpdateItemSpec="True"
DeleteItemsMarkAsExcludeTrue ="True"
Condition="'#(FilesForPackagingFromProject)' != ''">
<Output TaskParameter="ResultPipelineItems" ItemName="_FilesForPackagingFromProjectTempory"/>
</CopyPipelineFiles>-->
<!-- Copying files to package folder in 'custom'(dirty) way -->
<CreateItem Include="$(OutputPath)\**\*.*">
<Output TaskParameter="Include" ItemName="YourFilesToCopy" />
</CreateItem>
<Copy SourceFiles="#(YourFilesToCopy)"
DestinationFiles="#(YourFilesToCopy->'$(WPPAllFilesInSingleFolder)\%(RecursiveDir)%(Filename)%(Extension)')" />
Then
4. Your projectName.wpp.targets don't have to have FilesForPackagingFromProject, so it will look like:
<!-- targets -->
<PropertyGroup>
<DeployAsIisApp>false</DeployAsIisApp>
<IncludeSetAclProviderOnDestination>false</IncludeSetAclProviderOnDestination>
</PropertyGroup>
<ItemGroup>
<!-- intentionally left blank -->
</ItemGroup>
</Project>
That's it. Worked for me(tm), tested. Let me be honest, I don't like this approach, but that was the only way I made it working in the needed way. It's up to you whether you'll use it in your project or not.
My opinion is not to use msdeploy here - it was not for you task.
Better to write msbuild-scripts from scratch or accept the 'bin' folder, and fight against the framework again once next customization is required.

ivy report for entire repo?

I'm working on an internal ivy repository with a decent number of projects under it, each with many revisions. I would like to make a dependency report for the entire repository showing which versions of which artifacts depend on which revisions of other artifacts. Obviously it isn't too difficult to make a script to parse the published ivy xml files, but if this functionality exists already I'll use that. Something like the repreport task would be nice, but for a whole repo.
My main goal here is to get a report of artifacts that are not referenced by any other artifacts so as to make a list of candidates for removal from the repo.
So, does ivy have any way to build a dependency report against and entire repository?
Edit: Working through this, it looks like ivy:repreport is the way to go.
Here is my build.xml file:
<project name="Report Build" xmlns:ivy="antlib:org.apache.ivy.ant" basedir=".">
<property name="ivy.version" value="2.2.0"/>
<property name="ivy.home" value="${user.home}/.ivy2"/>
<target name="fetch-ivy" unless="offline" description="Install Ivy if it doesn't already exist">
<mkdir dir="${ivy.home}"/>
<get
src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar"
dest="${ivy.home}" usetimestamp="true"/>
</target>
<target name="init-ivy" depends="fetch-ivy" unless="ivy-initialized">
<path id="ivy.lib.path">
<fileset dir="${ivy.home}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
<property name="ivy-initialized" value="yes"/>
</target>
<target name="report" depends="init-ivy">
<ivy:settings file="ivy-settings-report.xml" id="report.ivy.settings"/>
<ivy:repreport settingsref="report.ivy.settings"/>
</target>
</project>
And here is my ivy settings file:
<?xml version="1.0" encoding="UTF-8"?>
<ivy-settings>
<settings defaultResolver="main"/>
<resolvers>
<chain name="main">
<url name="internalartifacts" m2compatible="false">
<artifact
pattern="http://internalartifacts.local/[organization]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"/>
<ivy pattern="http://internalartifacts.local/[organization]/[module]/[revision]/ivy-[revision].xml"/>
</url>
</chain>
</resolvers>
</ivy-settings>
The documentation for repreport says:
To generate a xml report for all the latest versions of all the
modules in your repository:
<ivy:repreport />
Limitation: this task requires to be able to browse the repository,
and is thus limited to resolvers supporting repository listing. In
particular, it means it doesn't work to report all organizations in a
repository using m2compatible mode. Moreover, to be able to list
organizations, this task requires an [organisation] token in the
resolver(s) used.
So this should totally work.
As mentioned in the comment:
It is important that your repository has ivy.xml files for the artifacts in it. Otherwise ivy cannot recognize the dependencies between the artifacts and your report will be empty.

NLog with VS 2008 Unit Test

I am trying log some entries in a log file (Log.Trace / Log.Debug) while my VS unit test runs. I have also copied the file NLog.config to out directory through DeploymentItem attribute over class. Still my log file is not created. Any help as to how can we log entries in a file same as we do for normal web application.
I've just found a solution to this problem:
Add the App.config file to yout unit test project with the following contents:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
</configSections>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="debugLog" xsi:type="Console" />
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="debugLog"></logger>
</rules>
</nlog>
</configuration>
You may put any configuration you wish as with NLog.config file.
Unfortunately that is the only XML solution at the time. It is not only about Unit Testing, though. NLog.config does not work with just any Console Application.
Do not know if it is by design or just an oversight. Anyway I would not say that moving NLog.config to App.config section is any way satisfactory =/
Maybe it is worth to notice that there is a possibility of configuring nlog directly from code, what could be helpful in some scenarios.
One could be also glad to find nlog debug option, that will log the whole process of processing configuration file, registering targets and so on...
To turn it on, just add internalLogFile and internalLogLevel attributes to nlog element:
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" internalLogFile="C:/logs/nlog.txt" internalLogLevel="Debug">
or from code:
InternalLogger.LogFile = #"c:\logs\nlog.txt";
InternalLogger.LogLevel = LogLevel.Trace;

Include a text file content into a WiX script

Is there a way to read value for the WiX variable from a text file?
What I am trying to do is to include a version-specific information into instlal package.
This version information extracted into the text file on the pre-build step,
the question is how to propages this text file content into a build process.
One of the possible solution is to update whole .wxs file on the pre-build step
too, but it feel a bit sloppy.
Is there any other, less-intrusive way?
Thank you.
Create a separate file 'includes.wxi', for example like this:
<?xml version="1.0" encoding="utf-8"?>
<Include Id="VersionNumberInclude">
<?define MajorVersion="1" ?>
<?define MinorVersion="5" ?>
<?define MicroVersion="99" ?>
<?define BuildVersion="14954" ?>
</Include>
In your wxs file, you can include this file like this:
<?include VersionNumberInclude.wxi ?>
And the defines can be used like this:
<?define VersionNumberInternal="$(var.MajorVersion).$(var.MinorVersion).$(var.BuildVersion)" ?>
<?define VersionNumberUserVisible="$(var.MajorVersion).$(var.MinorVersion).$(var.MicroVersion).$(var.BuildVersion)" ?>
In my environment, WiX scripts are always built by the MSBuild file. That means that I can pass in any version-specific information I want on the command line. CruiseControl.NET passes these version numbers to my WiX script when built.