Silverlight web project is always not up to date. That leads to web-project rebuilding each time, even if it's never changed and it's dependencies never changed.
Is it possible to build web-project only when neccessary, not every time I start an app using VS?
Minimal build log:
Build: 1 succeeded, 0 failed, <...> up-to-date, 0 skipped
Diagnostic build log:
Project '<...>.Web' is not up to date. Input file '<...>.xap' is modified
after output file '<...>.Web.pdb'.
I believe this may be related to how MSBuild deposits xap files into a web project's ClientBin directory after it has already compiled the dll/pdb for that web project.
Something that has worked for me is to add a command-line post-build event to the web project that "touches" the pdb file, copying it into the same location. This makes the pdb have a date-modified value that is after when the xap gets pulled into the ClientBin directory.
Here's the command:
copy /b "$(ProjectDir)obj\Debug\$(TargetName).pdb" +,,
Got the skeleton of the script from this StackOverflow answer: https://stackoverflow.com/a/1190325/1800930
You may have to change the path, depending on what specific error you're getting.
Related
I am building an android apk via 'Send Android build' and it shows that the build is successful. When I go to check the build server, it shows that it's empty.. Apparently with no build.
This is output in my console:
ant -f /home/falcon/NetBeansProjects/bizapp_mobile build-for-android-device
Generating GUI sources
No GUI Entries available
init:
deps-clean:
Updating property file: /home/falcon/NetBeansProjects/bizapp_mobile/build/built-clean.properties
Deleting directory /home/falcon/NetBeansProjects/bizapp_mobile/build
refresh-libs-impl:
Deleting directory /home/falcon/NetBeansProjects/bizapp_mobile/lib/impl
Deleting directory /home/falcon/NetBeansProjects/bizapp_mobile/native/internal_tmp
clean:
copy-android-override:
Created dir: /home/falcon/NetBeansProjects/bizapp_mobile/build/classes
copy-libs:
Copying 12 files to /home/falcon/NetBeansProjects/bizapp_mobile/build/classes
deps-jar:
Updating property file: /home/falcon/NetBeansProjects/bizapp_mobile/build/built-jar.properties
JavaFX Not loaded. Classpath=/home/falcon/.codenameone/designer_1.jar . Adding to classpath
Adding JavaFX to your project properties file at nbproject/project.properties
JavaFX should be correctly loaded the next time you run this project.
Restarting JVM with JavaFX in the classpath.
NOTE: If you are trying to debug the project, you'll need to cancel this run and try running debug on the project again. JavaFX should now be in your classpath.
JavaFX is loaded
Retina Scale: 1.0
Updating merge file /home/falcon/NetBeansProjects/bizapp_mobile/css/theme.css.merged
Input: /home/falcon/NetBeansProjects/bizapp_mobile/css/theme.css
Output: /home/falcon/NetBeansProjects/bizapp_mobile/src/theme.res
Acquiring lock on CSS checksums file /home/falcon/NetBeansProjects/bizapp_mobile/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/falcon/NetBeansProjects/bizapp_mobile/src/theme.res
Compile is forcing compliance to the supported API's/features for maximum device compatibility. This allows smaller
code size and wider device support
Created dir: /home/falcon/NetBeansProjects/bizapp_mobile/build/tmp
Compiling 42 source files to /home/falcon/NetBeansProjects/bizapp_mobile/build/tmp
Created dir: /home/falcon/NetBeansProjects/bizapp_mobile/build/empty
Created dir: /home/falcon/NetBeansProjects/bizapp_mobile/build/generated-sources/ap-source-output
Compiling 42 source files to /home/falcon/NetBeansProjects/bizapp_mobile/build/classes
warning: [options] bootstrap class path not set in conjunction with -source 8
1 warning
Copying 2 files to /home/falcon/NetBeansProjects/bizapp_mobile/build/classes
compile:
Created dir: /home/falcon/NetBeansProjects/bizapp_mobile/dist
Copying 1 file to /home/falcon/NetBeansProjects/bizapp_mobile/build
Not copying library /home/falcon/NetBeansProjects/bizapp_mobile/override , it's a directory.
Not copying library /home/falcon/NetBeansProjects/bizapp_mobile/lib/impl/cls , it's a directory.
Not copying library /home/falcon/NetBeansProjects/bizapp_mobile/lib/impl/stubs , it's a directory.
Not copying library /home/falcon/NetBeansProjects/bizapp_mobile/${cn1.javafx.path} , it can't be read.
Not copying library /home/falcon/NetBeansProjects/bizapp_mobile/native/internal_tmp , it can't be read.
Copy libraries to /home/falcon/NetBeansProjects/bizapp_mobile/dist/lib.
Building jar: /home/falcon/NetBeansProjects/bizapp_mobile/dist/BizApp.jar
To run this application from the command line without Ant, try:
java -jar "/home/falcon/NetBeansProjects/bizapp_mobile/dist/BizApp.jar"
Created dir: /home/falcon/NetBeansProjects/bizapp_mobile/native/internal_tmp
jar:
clean-override:
build-for-android-device:
BUILD SUCCESSFUL (total time: 11 seconds)
Where could I be going wrong?
EDIT
Now this is confusing...
When I ran 'Send Android build' when my PC is connected to internet, it gives that message I posted before.
So accidentally, I ran 'Send Android build' while my PC was offline and it passed that point and it showed me this pop up:
Now.. once I this pop-up shows, that's when I connect to internet and everything will flow as supposed to.
So its like, if I have internet connected right from the start, it isn't successful but if I connect to internet after showing me the popup of an invalid Android certificate, everything will work fine and the build will be in the build server.
But is causing this now?
I’m getting strange error while building project in Xcode 9.4
Build system information - unexpected service error: The Xcode build system has crashed. Please close and reopen your workspace.
I tried Xcode quit and reopen but that didn’t worked. Any solution?
Please clear derived data folder (located at ~/Library/Developer/Xcode/DerivedData) and restart the Xcode project.
This error usually happens between Xcode major versions. Apple usually claim their new build system is ** times faster than their previous version. If you see this error(I see this on changing Xcode9 to Xcode10 beta), you can always change it to the legacy build system. Here is how you can do this:
Open 'workspace settings'( it is now changed to 'Project Settings' if you are using Xcode10 or later) in the File Menu
Change build system to 'legacy'
Update for Xcode 13.4.1:
I had this infamous bug today as well. I tried a lot including clean project, delete derived, restart max etc.
What did the fix finally is similar to the answer of kakaiikaka: I set the workspace settings to "Legacy Build System (Deprecated)" for both, the shared and per user workspace. I tried to build with this, but got an error because I had packages wich are not supported.
Restarted Xcode, then changed back the build system. Restarted Xcode again.
Now the crash doesn't happen any more.
Looks like something internal was spoilt and cycling the build system fixed it.
I moved a lot of files all at once between folders, including nested folders. This error started happening. Nothing I did in regards to cleaning, purging derived data, or undoing the move operation would help.
What I did to help was: restore the previous version of the project file from source control and then re-add all the applicable new files to it. It was project file related. Deleting user data inside the project container did not help in my case. So as long as you use source control and can rollback the .xcodeproj, this may be an option.
it happened to me when i changed build configuration names. After deleting Pods folder and Podfile.lock, and then runnnig "pod install" fixed the issue.
For Xcode 10.2 delete podfile, podfile.lock, xcworkspace, open terminal, cd directory of project, pod init, add pods you want to pod file, pod install, open xcworkspac. Everything will be indexing now and then you can build.
Firstly, apologies if this has already been asked. I searched, but couldn't find anything specifically relating to this problem...
I'm having a big issue with CodedUI. In my case, I deploy my software to an environment, and then run the automated tests via visual studio on this environment. As the test starts, the test agent appears to copy files as it wishes into a temporary directory from which to run the tests, as suggested on this page:
https://msdn.microsoft.com/en-us/library/ms182475(v=vs.100).aspx
The following files and folders are copied to the deployment folder
before the tests are run:
•The test assembly file
•All dependent assemblies
•Files that you have specified, such as XML files and configuration
files, on which tests depend. You can configure deployment both by
specifying additional deployment items to be copied and by changing
the deployment folder.
My issue with this is that my tests reference a file that is present on my environment. Into the directory
"C:\Program Files (x86)\Common Files\Microsoft
Shared\VSTT\12.0\UITestExtensionPackages"
I have placed an extension package that allows me to interface with some third-party WPF UI components. This is in place on the environment, and my test projects within Visual Studio all reference the file in that location as a dependency, and have "Copy Local" set to false and "Specific Version" set to true.
The problem occurs when the test agent starts the tests, and copies all of the files it thinks it requires to the temporary test directory. It also copies this extension file, resulting in every test failing with the error:
System.InvalidCastException: [A]<type here> cannot be cast to [B]<same
type here>
As it appears to be referencing the one I intentionally placed there as well as the one the agent copied over. If I manually go in and remove the file, then tests will start to pass.
My question is: how do I prevent the test agent from copying this file? I know the file will always be in the location which I placed it and do not require it to be copied over.
I recently starting using a new Mac for development, and I have a cn1 app I've been working on on a Windows machine for a while. I installed Netbeans and the cn1 plugin, but I can't run the project or send a build. The error I get is this:
ant -f /Users/yaakov/Development/workspace/medonline_cn1 build-for-android-device
No GUI Entries available
init:
deps-clean:
Updating property file: /Users/yaakov/Development/workspace/medonline_cn1/build/built-clean.properties
Deleting directory /Users/yaakov/Development/workspace/medonline_cn1/build
refresh-libs:
Deleting directory /Users/yaakov/Development/workspace/medonline_cn1/lib/impl
clean:
copy-android-override:
Created dir: /Users/yaakov/Development/workspace/medonline_cn1/build/classes
Copying 8 files to /Users/yaakov/Development/workspace/medonline_cn1/build/classes
copy-libs:
Copying 96 files to /Users/yaakov/Development/workspace/medonline_cn1/build/classes
deps-jar:
Updating property file: /Users/yaakov/Development/workspace/medonline_cn1/build/built-jar.properties
compile-css:
/Users/yaakov/Development/workspace/medonline_cn1/build.xml:37: Could not find designer_1.jar file at path /Users/yaakov/.codenameone/designer_1.jar
BUILD FAILED (total time: 1 second)
The directory /Users/yaakov/.codenameone doesn't even exist. There is /Users/yaakov/.cn1 directory, however, but it's empty. The project is a GUI builder project. I'm running Java 8.
Assuming you installed the Codename One plugin on NetBeans just double click the res file. This will launch the designer and create that directory. Everything should work as expected after that.
I have the following files which I would like to upload to Artifactory as a 9.8.0 versioned artifact.
NOTE: The first two files DO NOT have an extension (they are executable files i.e. if you open them/cat on it, you'll see junk characters).
Folder/files of a given version 9.8.0 in CVS is like:
com.company.project/gigaproject/v9.8.0/linux/gigainstall
com.company.project/gigaproject/v9.8.0/solaris/gigainstall
com.company.project/gigaproject/v9.8.0/win32/gigainstall.exe
com.company.project/gigaproject/v9.8.0/gigafile.dtd
com.company.project/gigaproject/v9.8.0/gigaanotherfile.dtd
com.company.project/gigaproject/v9.8.0/giga.jar
com.company.project/gigaproject/v9.8.0/giga.war
Uploading the above files which have an extension is very easy... You log in to Artifactory as an administrator/user which has access to deploy artifacts, click on "Deploy" tab, browse for the Artifactory file and once you select the file, click on "Upload" button.
Next you'll see a screen (like shown above). You'll tweak what you want in the fields on this page and once you click on "Deploy Artifact", you are done. All you have to make sure is you select the correct file.extension file while uploading and make sure the file extension is shown in the "Target Path" box correctly (with the version -x.x.x, etc.).
My questions:
Question 1: How do I upload an artifact which doesn't have an extension? It seems like Artifactory by default takes an artifact as a .jar extension. How can I upload the "gigainstall" artifact as shown in the folder/file structure above for both Linux and Solaris? I see I can use the artifact name as gigainstall-linux and gigainstall-solaris and differentiate it, but I am not sure how to tell Artifactory that this artifact doesn't have any extension.
I don't think the development team will start generating this artifact with a proper extension (as this artifact may be hard coded everywhere in other projects where they are currently getting it from CVS/SVN source control somewhere - which is itself a bad practice to store an artifact in a source control version tool).
Question 2: How would I tell a build system (for example, Gradle) to consume a non-extensioned artifact during, let's say, 'compile' task. In build.gradle under section dependencies { .. }, I will add something like as shown below, but I am not sure for non-extensioned files (the first two in the folder/file structure I mentioned above).
dependencies {
//compile 'com.company.project:gigainstall-linux:9.8.0#'
//compile 'com.company.project:gigainstall-linux:9.8.0#??????'
//compile 'com.company.project:gigainstall-linux:9.8.0#""'
//compile 'com.company.project:gigainstall-linux:9.8.0#"none"'
//compile 'com.company.project:gigainstall-linux:9.8.0#"NULL_or_something"'
// The following will easily get giga.jar version giga-9.8.0.jar from Artifactory repository
compile 'com.company.project:giga:9.8.0'
// The following will easily get giga.war
compile 'com.company.project:giga:9.8.0#war'
// Similarly, other extension based artifacts can be fetched from Artifactory
compile 'com.company.project:gigafile:9.8.0#dtd'
compile 'com.company.project:gigaanotherfile:9.8.0#dtd'
}
Answer 1 (will cover 2 as well in a different sense): Using Artifactory "Artifact Bundle" feature section under "Deploy" tab can do the TRICK for AT LEAST uploading the artifacts in a way we want, by creating a zip file first (containing the structure and artifacts in it) --OR you can upload the artifacts using/calling Artifactory REST API way.
High level idea:
Create a zip file called gigaproject.zip OR anyname.zip/.tar/compressed file which Artifactory can read. Inside the zip, create the structure - how these artifacts will be loaded to Artifactory
i.e.
gigaproject.zip will contain the following folders/structure/files.
Case 1:
com/company/project/gigaproject/9.8.0/linux/gigainstall
com/company/project/gigaproject/9.8.0/solaris/gigainstall
com/company/project/gigaproject/9.8.0/win32/gigainstall.exe
com/company/project/gigaproject/9.8.0/gigafile.dtd
com/company/project/gigaproject/9.8.0/gigaanotherfile.dtd
com/company/project/gigaproject/9.8.0/giga.jar
com/company/project/gigaproject/9.8.0/giga.war
NOTE: In case 1 example, I didn't use any -x.x.x in the filename (i.e. I'm using plain and simple giga.jar instead of giga-9.8.0.jar).
The above Upload/Deploy will result the files (as shown in the following snapshot):
So, we have achieved what we wanted. Actually (visibly speaking yes), but not in a way Artifactory usually stores these artifacts (as they should -x.x.x version embedded in the file name and where artifact id should match the artifact filename). Now, if you want to consume the following in a Gradle build file, you CANNOT as first, you haven't uploaded the filename with -x.x.x version name in it, secondly, the artifact id in our case 1 tree was "gigaproject" (after com/company/project folder), so Gradle way of defining what artifact id and what artifact file name you want won't work.
compile 'com.company.project:gigaproject:CANNOTSAY_HOW_TO_GET_GIGA_JARorGIGAINSTALL_with_without_extension'
Conclusion: It's possible to upload any files (with/without extension in Artifactory) in any structure but it depends how your build system will consume it or will be able to consume it or not.
- I deleted the structure I just created with case 1 .zip file from Artifactory repository to try next case#2 and deleted the .zip file I created.
Case 2:
Let's create an individual versioned file name for each artifact and also create structure in the format - how Artifactory actually stores them (an artifact as seen in a repository in a tree view) and create a .zip file containing that structure. Let's use the same "Artifact Bundle" feature to upload this .zip file to upload individual artifacts that we need in Artifactory - where artifact-id (second value which we mention while trying to consume it) would match the artifactfile name in Artifactory.
Folder/file structure for the .zip file:
com/company/project/gigainstall/9.8.0/gigainstall-9.8.0.linux
com/company/project/gigainstall/9.8.0/gigainstall-9.8.0.solaris
com/company/project/gigainstall/9.8.0/gigainstall-9.8.0.exe
com/company/project/gigafile/9.8.0/gigafile-9.8.0.dtd
com/company/project/gigaanotherfile/9.8.0/gigaanotherfile-9.8.0.dtd
com/company/project/giga/9.8.0/giga-9.8.0.jar
com/company/project/giga/9.8.0/giga-9.8.0.war
NOTE: This time, we'll be using the same "Artifact Bundle" feature and for similar files (gigainstall under both Linux/Solaris folders), I took the approach of creating gigainstall folder (containing gigainstall-9.8.0.linux and gigainstall-9.8.0.solaris file names) i.e. when we'll consume these artifacts in Gradle under dependencies { ... } section for compile, we'll use x.x.x# way to fetch these artifacts from Artifactory.
OK, once "Artifact Bundle" Deploy/Upload was successfully complete, I got the following message.
Successfully deployed 7 artifacts from archive: gigaproject.zip (1 seconds).
Now, let's see how it looks like in Artifactory while searching for one of the artifact/in Tree view. You can see we have the files now in place, with filename-x.x.x.extension way so that I can consume them easily in Gradle.
In Gradle build file (build.gradle), I'll mention:
dependencies {
compile "com.company.project:gigainstall:9.8.0#linux"
compile "com.company.project:gigainstall:9.8.0#solaris"
compile "com.company.project:gigainstall:9.8.0#linux"
compile "com.company.project:giga:9.8.0
compile "com.company.project:giga:9.8.0#war
compile "com.company.project:gigafile:9.8.0#dtd
compile "com.company.project:gigaanotherfile:9.8.0#dtd
}
OH OH!! - That didn't work, see below for Gradle error. Why? - Artifactory Bundle upload/deploy feature uploads a zip file content what you have in the .zip but it DOES NOT create a .pom file per artifact it deploys. Thus, making the Gradle build to fail. May be in Ant this might succeed. This occurred for each individual .jar/.war/.dtd/etc file. I'm just showing one error example.
While doing gradle clean build
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve com.company.project:gigafile:0.0.0.
Required by:
com.company.project:ABCProjectWhichConsumesGIGAProjectArtifacts:1.64.0
> Could not GET 'http://artifactoryserver:8081/artifactory/ext-snapshot-local/com/company/project/gigafile/0.0.0/gigafile-0.0.0.pom'. Received status code 409 from server: Conflict
Case 3: Let's take a simple approach (workaround but will save a lot of pain).
Create gigaproject.zip file with the following structure, this approach takes - No x.x.x version value embedded in the individual artifact/filename in the folder/file structure. We will use "Single Artifact" approach (which will create the .pom for gigaproject.zip file automatically during the upload/deploy process provided by Artifactory). You'll still be able to get gigainstall file without needing any extension to its name using this approach. During the upload/deploy step, as you already have seen, you upload gigaproject.zip and artifactory will upload it to a given Target Repository as "gigaproject-x.x.x.zip" where x.x.x is 9.8.0 in our case. See the image snapshot below.
gigaproject/linux/gigainstall
gigaproject/solaris/gigainstall
gigaproject/win32/gigainstall.exe
gigaproject/gigafile.dtd
gigaproject/gigaanotherfile.dtd
gigaproject/gigaproject.zip
gigaproject/giga.jar
gigaproject/giga.war
Now, upload it in Artifactory using "Single Artifact" feature. Click "Deploy Artifact" once you tweak the values for GroupId, ArtifactId, Version, etc.
Once this is uploaded. You'll see in the zip artifact in the target repository (I took a bad example, usually this would be libs-snapshot-local or libs-release-local instead of ext-...), you'll be able to consume the ZIP artifact directly in Graddle:
dependencies {
// This is the only line we need now.
compile "com.company.project:gigaproject:9.8.0#zip"
}
Once the .zip is available to Gradle build system, now you can tell Gradle to unpack this .zip file somewhere in your build/workspace area where you can feed the actual(unpacked) files (gigainstall, .dtd, .jar, .war, etc.) to the build process/steps.
PS: Case# 1 and 2 would have worked for Ant I guess.
Answer 2:
If you have uploaded a non-extensioned file in either way. Make sure you have manually created/uploaded its POM file as well (i.e. if I uploaded gigainstall-9.8.0 as an artifact under com/company/project/gigainstall/9.8.0/gigainstall-9.8.0, then at the same level, I have to/should create it's POM file (see a simple template .pom file for a custom jar artifact or while uploading an extensioned file via "Single Artifact" deploy, you'll see what POM Editor window shows you) and upload both so that Gradle won't error out saying no POM conflict/error. Ant might not need pom (I didn't check that).
Once it's there in Artifactory, the following line should work -- OR comment please if you find another way.
dependencies {
// See nothing mentioned after - x.x.x#
compile "com.company.package:gigainstall:9.8.0#"
}