w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
visual studio, build configuration: how to make a build configuration that is based on another
Here's an example for using different preprocessor definitions. You'll have to manually edit the project file. I suggest you do this in VS itself since it has syntax highlighting and autocomplete for it. In a normal csproj file, the properties for the Debug|AnyCPU config are defined like this (1): <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> <DebugType>pdbonly</DebugType> <Optimize>false</Optimize> <OutputPath>binDebug</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> Say you want to reuse everything except DefineCo

Categories : Visual Studio

Does this expression require optimization or not?
I think by "optimization", you mean "redundancy reduction" aka Don't Repeat Yourself? Essentially, you have a bunch of metrics. You want to check if, for any of those metrics, the value of that metric for an ad on a daily basis deviates from the sum of that metric on an hourly basis. Once you think of it that way, you can do: Func<Stat, int>[] metricGetters = { stat => stat.Impressions, stat => stat.Clicks, // .. etc. etc. }; return metricGetters.Any(getter => getter(adStat.Daily) != adStat.Hourly.Sum(h => getter(h.Value)));

Categories : C#

require.js optimization: deep dependencies
Make sure that in your build file (the one you pass to r.js as a build config), you have: findNestedDependencies: true R.js is omitting so called "inline dependencies" by default so if you do have in your main.js i.e. require(["sth"],function(){ require(["sthelse"]); }); R.js will only load "sth" by assuming that "sthelse" should be loaded during runtime. ; )

Categories : Javascript

SignalR & require.js configuration
This works for me with SignalR 1.1.2: require.config({ baseUrl: "/<your scripts dir>", paths: { "jquery": "jquery-<your jquery version>.min", "signalr.core": "jquery.signalR-<your signalr version>.min", "signalr.hubs": "/signalr/hubs?" }, shim: { "jquery": { exports: "$" }, "signalr.core": { deps: ["jquery"], exports: "$.connection" }, "signalr.hubs": { deps: ["signalr.core"], } } }); require(["jquery", "signalr.hubs"], function($) { var hubProxy = $.connection.myHub; // ... go to town ... });

Categories : Javascript

Require.js build not concatenation scripts loaded with Jam
require.js is never included by r.js unless you instruct it to do so. See this link: http://requirejs.org/docs/optimization.html#onejs The link refers to command-line options, but the build file options are broadly the same: you need to define a dummy module for require.js in your paths: paths: { requireLib : '/path/to/require.js' backbone: '../vendor/jam/backbone/backbone', 'backbone.layoutmanager': '../vendor/jam/backbone.layoutmanager/backbone.layoutmanager', jquery: '../vendor/jam/jquery/jquery', lodash: '../vendor/jam/lodash/backbone.min' }, and include it: name "main", include: ["requireLib"], You can ensure that allnested dependencies are resolved by setting: findNestedDependencies: true, You can configure an output path using 'out' in your build

Categories : Backbone Js

R.js build doesn't follow require.config file
I wonder if it is the way you defined your config. Is there any reason for the init.js as opposed to just putting the require.config in main? It seems unnecessary to create an anonymous function just to encapsulate it. From the example r.js build file: The first requirejs({}), require({}), requirejs.config({}), or require.config({}) call found in that file will be used. What has always worked for me is to follow the more standard method of calling require.config() inside main.js

Categories : Backbone Js

Configuration Manager Vs. Properties Build
It simply lets you skip building a project in that particular configuration by unticking it. Necessary if the project cannot or should not be built in that configuration. This is a pretty rare thing to do but can be useful if, say, you only want to build an installer in the Release build or have a project that cannot be built in the configuration. The notion of having distinct platforms is important to unmanaged code, very unimportant to managed code. Since managed code is naturally oblivious to the target architecture, the jitter takes care of it at runtime. The name of the Platform also has nothing to do with the architecture the program can run in, the only setting that matters is Project + Properties, Build tab, Platform target setting. And only for an EXE project. Having a misma

Categories : Dotnet

C# read custom configuration build
You can use conditional compilation symbols ( http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k(CS.PROJECTPROPERTIESBUILD);k(TargetFrameworkMoniker-%22.NETFRAMEWORK%2cVERSION%3dV4.0%22)&rd=true ) for your build modes. In your code you can then use the #if directive http://msdn.microsoft.com/de-de/library/4y6tbswk(v=vs.100).aspx

Categories : C#

TFS Workflow If Statement using Build Configuration
To answer your basic question about an "if" in a workflow, open the worflow xaml file in the designer. Go to View > Toolbox. Under the heading "Control Flow" there is an "If" activity that you can drag and drop into your workflow. A workflow can have multiple projects and solution being built in multiple configurations. The workflow contains an argument, BuildSettings, which has a property called PlatformConfigurations. The default template will loop through all PlatformConfigurations for all projects in the "Compile and Test" sequence. You may just want to grab the platformConfiguration variable in that loop and get the Configuration and put the if either before or after the MSBuild activity or you may need additional logic for specific project you want to act on.

Categories : Visual Studio 2012

XCode: Possible to specify CFBundleIdentifier per-build-configuration?
I spend much of my day building a white-label product, so I have to do this all the time. The solution we came up with was to use an Xcode "Run Script" build phase as a "postflight" script. In your project file, select the target, Build Phases, and then add a new "Run Script" build phase. I renamed the phase to "postflight" and ensured to move the phase to be the last thing done amongst all the build phases. The essential thing the postflight script does is look for the built .app package, look for the Info.plist within it, and then change the CFBundleIdentifier within it for whatever our present build configuration is set for. Our script does a lot more than just this (other logic, post-processing, resource manipulations, etc.). I can't provide too many specifics since my setup is cus

Categories : Xcode

Will any of the following configuration affect the performance of the release build
No, adding debug information to the build will not in anyway effect the optimisation settings or speed of the final build. All it will do is add a path and checksum to the executable/dll so it can find the and verify the associated pdb and generate said pdb. Its been a long time since adding debug information in VS actually affected the final exe/dll. It can however affect build time, as its got to generate the relevant pdb, but its pretty easy to measure whether this'd affect your scenario.

Categories : C++

How to create reusable build configuration in maven?
You can parameterized them with maven properties, override them after it is inherited. In your case, you can introduce mainClass property and use it in your plugin configuration from the parent module, for example <mainClass>${mainClass}</mainClass>. This properties then can be overridden in the child modules. EDIT: For the parent pom, I was referring to the pluginManagement section (Sorry for the unclearness). I have created an example with your build configuration here: https://gist.github.com/ceilfors/5827916 I think that's the minimum that you can get in the child module. maven-jar-plugin is optional because of the jar packaging type. Refer to the lifecycle bindings and you can see that the plugin will be called during package phase. Also, when your project gets more com

Categories : Java

Add default build configuration to Visual Studio
Yes, create a custom project template. If this does not suffice, you can even create a custom project type, which is a bit more involved, however.

Categories : Visual Studio

Maximum performance configuration for a release build VS2010
If you want to get the most optimized code from your compiler, you can try a profile guided optimization of your critical code. However, this kind of optimization is not as easy to achieve than simply tweaking to compiler options. The achieve this, you will need to have a suite of tests that represents real-life scenarios. Instrument you code, run theses tests, and then: The instrumentation data will tell you where you spend most of your CPU time. Try to optimize (by hand) the parts of your code that seems to take a lot of CPU. Compile again your critical code with the instrumentation data as input. I have never used this with Visual Studio (only Intel Compilers). VS2010 seems to have profile-guide optimization features.

Categories : C++

Build configuration management in Android / Intellij / Jenkins
This question is somewhat opinion based since in a complex project there are always more than 1 suitable solutions. Preamble I will try to explain some principles I used to deploy Linderdaum Puzzle HD. The game has paid and free versions which differs not only in code, but in UI and in game content. The game is released for two platforms and several stores (which all have different authorization mechanism): Android: Google Play (2: free+paid) AndroidPit (2: free+paid) SlideMe (1: free) Samsung store (1: free) Blackberry OS 10 BlackBerry World (1: paid) Windows We use this version for development and testing on a PC (1: paid) This gives us 8 different distribution packages. Environment Our production toolchain is based on git and TeamCity. No special tools (like Maven, Gr

Categories : Android

SBT plugin - User defined configuration for Command via their build.sbt
Take a look at the example here: http://www.scala-sbt.org/release/docs/Extending/Plugins.html#example-plugin In this example, a task and setting are defined: val newTask = TaskKey[Unit]("new-task") val newSetting = SettingKey[String]("new-setting") val newSettings = Seq( newSetting := "test", newTask <<= newSetting map { str => println(str) } ) A user of your plugin could then provide their own value for the newSetting setting in their build.sbt: newSetting := "light" EDIT Here's another example, closer to what you're going for: Build.scala: import sbt._ import Keys._ object HelloBuild extends Build { val newSetting = SettingKey[String]("ne

Categories : Scala

Why can't Maven build resolve Spring @Bean @Configuration etc annotations?
There is a duplicate dependency of org.springframework:spring-context in your POM that is probably causing classpath conflicts. The first one is a compile dependency using version 3.2.4.RELEASE, and the second one is a runtime dependency using version 3.0.0.RELEASE. I suggest you remove the second since it's unnecessary and should be superseded by the first.

Categories : Java

Xcode - Run Post-Actions Script in Specific Build Configuration
Yes; in your script the $CONFIGURATION variable will be set: #!/bin/sh if [ "$CONFIGURATON" != "Release" ]; then exit 0 fi # Does stuff only in Release build See this SO question to get a list of other Xcode variables that might interest you.

Categories : Xcode

Android - dynamic configuration in gradle based on build type
There is an much easier solution available: Use a static final in BuildConfig: buildTypes { debug { def host = InetAddress.getLocalHost().getCanonicalHostName() buildConfig "public static final String API_HOSTNAME = "" + host + "";" } release { buildConfig "public static final String API_HOSTNAME = "whateveritisforreleasebuilds";" } } BuildConfig.API_HOSTNAME will hold the remote address.

Categories : Android

In Xcode, how can you check environment variables to know which build configuration or scheme you have selected?
This worked for me: if [[ "$CONFIGURATION" == "Debug" ]] then echo "Copying ./BundlePrivate b/c BuildConfiguration=$CONFIGURATION" ditto ./BundlePrivate/ "$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH" else echo "Not copying ./BundlePrivate b/c BuildConfiguration=$CONFIGURATION" fi

Categories : Xcode

How do I suppress Xcode from generating a folder named after the build configuration in cmake?
You'll need to specify the target properties ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>, LIBRARY_OUTPUT_DIRECTORY_<CONFIG>, and/or RUNTIME_OUTPUT_DIRECTORY_<CONFIG> for each config type and each target you want to affect. To affect all targets, you can set variables named as these with CMAKE_ prepended. Any relevant target added after these have been set will be affected. So, for example you could either do: add_library(MyLib ${Sources}) set_target_properties(MyLib PROPERTIES ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR} ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}) or you could do: set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}) add_library

Categories : Xcode

build configuration : Java backend (Spring + Maven) with JS project (Angular)
For development purposes, I would let Tomcat include the front-end folder in the server.xml by means of a <Context> tag. The folder can be arbitrary and even in another repository (e.g. /GitRepos/ApplicationGui/app). ... <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true"> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t &quot;%r&quot; %s %b" prefix="localhost_access_log." suffix=".txt"/> <Context docBase="/workspace/JsFrontend" path="/"/> <Context docBase="FlexibleOrders" path="/FlexibleOrders" reloadable="true" source="org.eclipse.jst.j2ee.server:FlexibleOrders"/> </Host> </Engine> </Service> </Server> In

Categories : Angularjs

TypeScript with require.js and jquery does not work on production server (require.js Script Error)
Are you compiling your website in Release mode when you are deploying to your server? In that case you need to add a release version in the project file: <PropertyGroup Condition="'$(Configuration)' == 'Release'"> <TypeScriptSourceMap> --module AMD</TypeScriptSourceMap> </PropertyGroup> <Target Name="BeforeBuild"> <Message Text="Compiling TypeScript files" /> <Message Text="Executing tsc$(TypeScriptSourceMap) @(TypeScriptCompile ->'&quot;%(fullpath)&quot;', ' ')" /> <Exec Command="tsc$(TypeScriptSourceMap) @(TypeScriptCompile ->'&quot;%(fullpath)&quot;', ' ')" /> </Target> In TypeScript 0.8.2+ the format is: <PropertyGroup Condition="'$(Configuration)' == 'Debug'"> <TypeScr

Categories : Jquery

Avoid duplication of "paths" configuration in RequireJS main file and r.js build file?
If you want to use same configuration from your runtime code to find the location of your libraries, you can use the mainConfigFile option: ...if you prefer the "main" JS file configuration to be read for the build so that you do not have to duplicate the values in a separate configuration, set this property to the location of that main JS file. The first requirejs({}), require({}), requirejs.config({}), or require.config({}) call found in that file will be used. Something like this: ({ baseUrl: "bower_components", mainConfigFile: '/some/path/main.js', // adjust path as needed name: "./almond/almond", include: "./../public/main", out: "build/main.js", preserveLicenseComments: false })

Categories : Javascript

cmake: check if file exists at build time rather than during cmake configuration
You can use add_custom_command to invoke CMake itself in script mode by using the -P command line option. So your command would be something like: set(FileToCheck "/the/file") add_custom_command(TARGET MyExe POST_BUILD COMMAND ${CMAKE_COMMAND} -DFileToCheck=${FileToCheck} -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake COMMENT "Checking if ${FileToCheck} exists...") and your script file "check.cmake" would be something like: if(EXISTS ${FileToCheck}) message("${FileToCheck} exists.") else() message("${FileToCheck} doesn't exist.") endif()

Categories : File

Check jquery in paths / require.config - Require.js
Please Checkout this http://blog.falafel.com/blogs/basem-emara/2013/03/01/how-to-avoid-loading-jquery-twice-with-requirejs. It might help.

Categories : Javascript

Does Django require an IDE an does ASP.NET require Visual Studio?
The need to recompile your code while using Visual Studio is due to the design of the programming language used - not due to Visual Studio. Java is the same, whether or not you are using NetBeans, Eclipse, or NotePad. An IDE is typically not required, but as you pointed out, it makes life easier. I started out using vim to program in Python - but now use Eclipse. Django comes with built-in command line tools to help you build your initial project, but in theory, you could manually create these files.

Categories : Asp Net

How to create a two or three different build using Gradle build system, each build pointing to different server?
(If I understand) I would use an external executable that prepare a batch file for each build. The .bat file calls gradle passing a variable (conaining the key) to it: gradle assemble -Pkey=%key% Now, inside the gradle script you can get the value of the variable: def varKey = "$key" and you can use it to sign the apk: signingConfigs { release { storeFile = file('../key.keystroke') storePassword = varKey keyAlias = "My key" keyPassword = varKey } } EDIT: Ok, the previous text is useful to sign the apk file with different keys. To edit the server url using gradle, first you need to store the url and api key into a resource string and use from inside the java class instead of the hard coded strings: <resources> <str

Categories : Android

EF Code First Configuration of shared Base Class --> Single Configuration File
Try it like below but I didnt test it .However if I were you, I wouldnt design Audit tables this way class AuditableModelBaseMap : EntityTypeConfiguration<AuditableModelBase> { public AuditableModelBaseMap () { this.HasRequired(amb => amb.CreatedByUserProfile).WithMany().HasForeignKey(amb => amb.CreatedByUserId).WillCascadeOnDelete(false); this.HasRequired(amb => amb.UpdatedByUserProfile).WithMany().HasForeignKey(amb => amb.UpdatedByUserId).WillCascadeOnDelete(false); } } THIS IS MY WAY OF Doing AUDITING public interface IEntity { int Id { get; set; } } public interface IAuditable : IEntity { string UpdatedBy { get; set; }

Categories : C#

static library builds in debug configuration but not in release configuration
For your project target Build Settings, look for "Search Paths->Header Search Path". Compare your Release and Debug settings here. Also look into the "Build Location" for the library project for Release and Debug.

Categories : IOS

Is there a way to obtain a Configuration object from a configuration file in the isolated storage?
Why can't you get the absolute path to the files in Isolated Storage? Take a look at the Can I get a path for a IsolatedStorage file and read it from external applications? post to find out how you can do this. If that doesn't work for you, take a look at the IsolatedStorageFile Class page at MSDN which features examples of manipulating files in IsolatedStorage.

Categories : Wpf

what is active solution configuration in vs 2012 configuration manager?
my understanding is it should use the QA web.config file. am i wrong? Actually you are wrong. web.QA.config will be used only when you publish your application but not while running it in Visual Studio where the standard web.config is always used.

Categories : Visual Studio 2010

log4j.properties configuration issues along with ant configuration
for ant i added: <path id="properties"> <dirset dir="${config.dir}"/> </path> where ${config.dir} is the path to the /src/config folder where the log4j.properties exists. Still working on getting eclipse to work, it shouldnt be too different with classpaths in eclipse. Thanks!

Categories : Java

Rspec spec_helper configuration issue: undefined method `syntax=' for # (NoMethodError)
The ability to execute the configuration option you specified (i.e. `mocks.syntax) is a recently added feature, introduced in RSpec 2.14.0, so you'll get this error until you upgrade to this version or later. As for the VCR warning, it seems to have been addressed by the latest version of VCR available at github (July 26, 2013), which advertises support through WebMock 1.13. However, the latest released version (2.5.0) is from May, so you'll just have to live with this warning unless you want to pull VCR directly from github.

Categories : Ruby On Rails

How to refer to one configuration variable from other configuration variable inside Config.groovy
You need to declare a variable: def rootVar = 'a' grails.variable1 = rootVar grails.varibale2 = "${rootVar}bc" Or you might be able to do it via a closure (not tested): grails.variable1 = 'a' grails.varibale2 = { -> "${grails.variable1}bc" }()

Categories : Grails

Enable/disable a admin configuration of a module based on other configuration of other module
No, but you can make your own source model to achieve this. Anyway, why don't you just check if module B is enabled when testing the same thing for module A ? So your condition would be induced by your code, and not by some system config fields that would not be really safe regarding what you want to do (you could enable module A when module B is also enabled, but then what would happen if module B gets disabled later ?)

Categories : Magento

In Jenkins, if next trigger build is in pending state then how to abort running build and start running next pending build?
Based on the comments, if sending too many emails is the actual problem, you can use Poll SCM to poll once in 15 minutes or so, or even specify quiet time for a job. This will ensure that build is taken once in 15 minutes. Users should locally test before they commit. But if Jenkins itself is used for verifying the commits I don't see anything wrong in sending an email if build fails. After all, they are supposed to know that, no matter even if they fixed it in a later update intentionally or unintentionally. But if you still want to abort a running job if there are updates, you can try the following. Lets call the job to be aborted as JOB A Create another job that listens on updates same as that of the job that needs to be aborted Add build step to execute groovy script In the groovy s

Categories : Jenkins

Jenkins email configuration - Test email configuration succeeds but email is not recieved by user
In order to get this to work, a valid email must be entered into the "System Admin e-mail address" field. That field is on the same page but is located in another section higher up. Without doing so, I too received a message that the email was successfully sent but I never received it. Once I set it, the test emails started to be received properly.

Categories : Jenkins

Build "*.DTPROJ" - SSIS on the build server with devenv.exe (Visual Studio 2012)
There was bug in initial release of SSDT-BI which was fixed in the following release http://www.microsoft.com/en-us/download/details.aspx?id=36843 Find here response from Microsoft Feedback site for above probelm http://connect.microsoft.com/SQLServer/feedback/details/781872/fail-to-build-ssis-ssas-projects-via-vs2012-command-line-devenv-exe-with-ssdt-bi-tool-installed

Categories : C#

Need TFS Build that copies documentation files to network share on check-in (but there is no sln to build) - like VSS shadow
You can create a dummy SOLUTION to get by the build definition where it asks for the SOLUTION to build part. You can create a dummy/blank solution file like this New Project -> Other Project Type -> Visual Studio Solution -> Blank Solution. Use that SLN file within the build defintion. Then edit your default build template and add the CopyDirectory and InvokeProcess activity to do the additional copy work (to the share) that you want to do. If you want to copy an entire directory you can use the CopyDirectory activity or if you want to copy specific file extensions etc you can use the InvokeProcess activity. CopyDirectory is straight forward, you just add the source and destination location and you are good to go. For InvokeProcess you can enter the "FileName = xcopy.exe" and fill in th

Categories : Tfs



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.